aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-02-04 21:24:30 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-02-04 21:24:30 +0000
commitaf96bccf44a68436ea49cfdb940f0500beb64a23 (patch)
treeb59f7bfb753d908206604cc1b761b94c0eece3a8
parentb26977973942e1ee88e9e52c547615a853548eec (diff)
downloadqmmp-af96bccf44a68436ea49cfdb940f0500beb64a23.tar.gz
qmmp-af96bccf44a68436ea49cfdb940f0500beb64a23.tar.bz2
qmmp-af96bccf44a68436ea49cfdb940f0500beb64a23.zip
mad plugin: fixed channel number detection (reported by Grzegorz Gibas)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1548 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/plugins/Input/mad/decoder_mad.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.cpp b/src/plugins/Input/mad/decoder_mad.cpp
index 7ae79a580..b6d7c3edb 100644
--- a/src/plugins/Input/mad/decoder_mad.cpp
+++ b/src/plugins/Input/mad/decoder_mad.cpp
@@ -214,11 +214,17 @@ bool DecoderMAD::findHeader()
stream.error = MAD_ERROR_NONE;
}
- if (mad_header_decode(&header, &stream) == -1)
+ if (mad_header_decode(&header, &stream) < 0)
{
- if (stream.error == MAD_ERROR_BUFLEN)
+ if(stream.error == MAD_ERROR_LOSTSYNC)
+ {
+ uint tagSize = findID3v2((uchar *)stream.this_frame,
+ (ulong) (stream.bufend - stream.this_frame));
+ if (tagSize > 0)
+ mad_stream_skip(&stream, tagSize);
continue;
- else if (MAD_RECOVERABLE(stream.error))
+ }
+ else if (stream.error == MAD_ERROR_BUFLEN || MAD_RECOVERABLE(stream.error))
continue;
else
{