patch-mpcchap_mpcchap_c 1014 B

1234567891011121314151617181920212223242526272829303132333435
  1. $OpenBSD: patch-mpcchap_mpcchap_c,v 1.1.1.1 2012/05/24 18:25:56 shadchin Exp $
  2. --- mpcchap/mpcchap.c.orig Fri Dec 2 04:21:33 2011
  3. +++ mpcchap/mpcchap.c Fri Dec 2 04:27:40 2011
  4. @@ -24,7 +24,7 @@
  5. #include <sys/stat.h>
  6. -#include <cuetools/cuefile.h>
  7. +#include <libcue/libcue.h>
  8. // tags.c
  9. void Init_Tags ( void );
  10. @@ -153,13 +153,19 @@ mpc_status add_chaps_ini(char * mpc_file, char * chap_
  11. mpc_status add_chaps_cue(char * mpc_file, char * chap_file, mpc_demux * demux, mpc_streaminfo * si)
  12. {
  13. Cd *cd = 0;
  14. - int nchap, format = UNKNOWN;
  15. + int nchap;
  16. struct stat stbuf;
  17. FILE * in_file;
  18. + FILE * cue_file;
  19. int chap_pos, end_pos, chap_size, i;
  20. char * tmp_buff;
  21. - if (0 == (cd = cf_parse(chap_file, &format))) {
  22. + if ((cue_file = fopen(chap_file, "r")) == NULL) {
  23. + fprintf(stderr, "%s: error opening file\n", chap_file);
  24. + return !MPC_STATUS_OK;
  25. + }
  26. +
  27. + if (0 == (cd = cue_parse_file(cue_file))) {
  28. fprintf(stderr, "%s: input file error\n", chap_file);
  29. return !MPC_STATUS_OK;
  30. }