Browse Source

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 89a420b71b.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0
Dale Curtis Michael Niedermayer 8 years ago
parent
commit
42323c3e3a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/mpegaudio_parser.c

+ 7
- 0
libavcodec/mpegaudio_parser.c View File

@@ -23,6 +23,7 @@
#include "parser.h"
#include "mpegaudiodecheader.h"
#include "libavutil/common.h"
#include "libavformat/apetag.h" // for APE tag.
#include "libavformat/id3v1.h" // for ID3v1_TAG_SIZE

typedef struct MpegAudioParseContext {
@@ -120,6 +121,12 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
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_size = buf_size;
return next;


Loading…
Cancel
Save