aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
{