From 6de76a3d74f0626a533884b894e14bed5894807f Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 21 Jun 2014 17:33:16 +0200 Subject: cue: ignore multifile cuesheets, as they are not supported (bug #971) --- playlist.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'playlist.c') 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; -- cgit v1.2.3