fix_msf_offset.diff 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Description: Don't assume MSF offset is always 150 (#439790)
  2. Author: Martin Michlmayr <tbm@cyrius.com>
  3. Last-Update: 2007-10-21
  4. Index: mkcue-1/mkcue.cc
  5. ===================================================================
  6. --- mkcue-1.orig/mkcue.cc 2004-10-27 07:20:30.000000000 +0100
  7. +++ mkcue-1/mkcue.cc 2012-11-10 13:34:34.986131069 +0000
  8. @@ -12,6 +12,9 @@
  9. #include "diskid.h"
  10. +/* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439790 */
  11. +#define MSF_OFFSET 150
  12. +
  13. void
  14. DiskId::ReportError(char *err)
  15. {
  16. @@ -54,16 +57,12 @@
  17. }
  18. puts("FILE \"dummy.wav\" WAVE");
  19. - puts(" TRACK 01 AUDIO");
  20. - puts(" INDEX 01 00:00:00");
  21. #define min(x, y) ((x) < (y) ? (x) : (y))
  22. - for (track = cdinfo.FirstTrack + 1;
  23. + for (track = cdinfo.FirstTrack;
  24. track <= min(trackcount, cdinfo.LastTrack);
  25. track++) {
  26. - /* There is frequently (always?) an offset of 150 sectors, so
  27. - * subtract the first track's offset. */
  28. - cdinfo.FrameOffset[track] -= cdinfo.FrameOffset[1];
  29. + cdinfo.FrameOffset[track] -= MSF_OFFSET;
  30. minutes = seconds = sectors = 0;
  31. sectors = cdinfo.FrameOffset[track] % 75;
  32. @@ -76,6 +75,9 @@
  33. }
  34. printf(" TRACK %02d AUDIO\n", track);
  35. + if (track == 1 && cdinfo.FrameOffset[track] > 0) {
  36. + printf(" INDEX 00 00:00:00\n");
  37. + }
  38. printf(" INDEX 01 %02d:%02d:%02d\n", minutes, seconds, sectors);
  39. }