]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegaudio_parser.c
avcodec: Remove deprecated VBV delay field
[ffmpeg] / libavcodec / mpegaudio_parser.c
index 8c39825792282d16c26d0ec68c56d1826c7f58d3..1005e89aaeabd253a5d7704b3825268ef10d4dc6 100644 (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 {
@@ -98,7 +99,9 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
                     } else if (codec_id == AV_CODEC_ID_MP3ADU) {
                         avpriv_report_missing_feature(avctx,
                             "MP3ADU full parser");
-                        return 0; /* parsers must not return error codes */
+                        *poutbuf = NULL;
+                        *poutbuf_size = 0;
+                        return buf_size; /* parsers must not return error codes */
                     }
 
                     break;
@@ -120,6 +123,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;