-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bchunk writes "ugh" files when there are spaces at the end of the lines into the CUE file #8
Comments
This can be fixed with something like this, but it should be applied to all the @@ -224,7 +224,7 @@ void gettrackmode(struct track_t *track, char *modes)
track->bsize = 2336;
track->extension = ext_iso;
- } else if (!strcasecmp(modes, "AUDIO")) {
+ } else if (!strncasecmp(modes, "AUDIO", 5)) {
track->bstart = 0;
track->bsize = 2352;
track->audio = 1; It's indeed a clever way to use bchunk, but there should be no need to use -w when the entire inputfile is a WAV file, it should be easy to detect if it's a wav file and set |
Yes, I'm sure you're right. But... |
I get what you mean, the question is does bchunk handle WAV files? I don't think so, I hear noise (aplay, music players don't recognize it) after splitting a wav file with a cue. So it has to be raw audio file or something, not a RIFF WAV file. The concept is appealing though and I guess it can be implemented. Anyway here is something that fixes this issue and other issues with trailing spaces in the TRACK line or command diff --git a/bchunk.c b/bchunk.c
index 52f1aa9..9057aaf 100644
--- a/bchunk.c
+++ b/bchunk.c
@@ -456,7 +456,11 @@ int main(int argc, char **argv)
track->bsize = track->bstart = -1;
track->bsize = -1;
track->startsect = track->stopsect = -1;
-
+
+ // remove trailing spaces
+ for (t = p; *t ; ) t++;
+ for ( ; *t <= 0x20; t--) *t = '\0';
+
gettrackmode(track, p);
} else if ((p = strstr(s, "INDEX"))) { |
Hello,
OK, I'm pretty sure nobody understood what I said...
I regularly use bchunk to split audio files, according to the related CUE files, with the "-w" parameter :
/usr/bin/bchunk -w -v fic.wav fic.cue fic_
Today, I found a (certainly) malformed CUE file, containing one additional space at the end of each line. In this case, bchunk writes binary files with the ".ugh" extension. If I remove these spaces, bchunk writes WAVE files correctly.
I don't know if this behaviour is intentional, but the problem, for me, is that "-w" should be sufficient to get WAVE files, but it isn't : bchunk ignores it if it detects something else into the CUE file.
The text was updated successfully, but these errors were encountered: