summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-06-21 17:33:16 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-06-21 17:33:55 +0200
commit6de76a3d74f0626a533884b894e14bed5894807f (patch)
tree262f00814a03a5786dc628f22303298119ecf73e /playlist.c
parentdd563895851aca5e7a6504f1fc0264a341ab9eab (diff)
cue: ignore multifile cuesheets, as they are not supported (bug #971)
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/playlist.c b/playlist.c
index d3d3a6be..92838ca7 100644
--- a/playlist.c
+++ b/playlist.c
@@ -1042,6 +1042,25 @@ plt_insert_cue_from_buffer (playlist_t *playlist, playItem_t *after, playItem_t
buffersize -= 3;
}
+ // go through the file, and verify that it's not for multiple tracks
+ int fcount = 0;
+ uint8_t *p = (uint8_t *)buffer;
+ uint8_t *e = (uint8_t *)(buffer + buffersize);
+ while (*p) {
+ while (*p <= 0x20 && *p) {
+ p++;
+ }
+ if (e-p > 4 && !memcmp ((char *)p, "FILE", 4) && p[4] == 0x20) {
+ fcount++;
+ if (fcount > 1) {
+ return NULL;
+ }
+ }
+ while (*p >= 0x20 && *p) {
+ p++;
+ }
+ }
+
const char *charset = junk_detect_charset_len (buffer, buffersize);
LOCK;