Commit 42323c3e authored by Dale Curtis's avatar Dale Curtis Committed by Michael Niedermayer

avcodec/mpegaudio_parser: Skip APE tags when parsing mp3 packets.

Otherwise the decoder will throw "Missing header" errors when the
packets are sent for decoding.

This is similar to 89a420b7.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b99e77b9
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "parser.h" #include "parser.h"
#include "mpegaudiodecheader.h" #include "mpegaudiodecheader.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavformat/apetag.h" // for APE tag.
#include "libavformat/id3v1.h" // for ID3v1_TAG_SIZE #include "libavformat/id3v1.h" // for ID3v1_TAG_SIZE
typedef struct MpegAudioParseContext { typedef struct MpegAudioParseContext {
...@@ -120,6 +121,12 @@ static int mpegaudio_parse(AVCodecParserContext *s1, ...@@ -120,6 +121,12 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
return next; return next;
} }
if (flush && buf_size >= APE_TAG_FOOTER_BYTES && memcmp(buf, APE_TAG_PREAMBLE, 8) == 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
return next;
}
*poutbuf = buf; *poutbuf = buf;
*poutbuf_size = buf_size; *poutbuf_size = buf_size;
return next; return next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment