lavf/concatdec: clear extradata when inserting h264_mp4toannexb bsf.
authorNicolas George <george@nsup.org>
Mon, 25 Apr 2016 11:46:10 +0000 (13:46 +0200)
committerNicolas George <george@nsup.org>
Tue, 26 Apr 2016 14:58:59 +0000 (16:58 +0200)
Fix remuxing H.264-in-MP4 to Matroska, possibly others.

libavformat/concatdec.c

index b2bab55..b3a430e 100644 (file)
@@ -214,6 +214,12 @@ static int detect_stream_specific(AVFormatContext *avf, int idx)
         if (!cs->avctx)
             return AVERROR(ENOMEM);
 
+        /* This really should be part of the bsf work.
+           Note: input bitstream filtering will not work with bsf that
+           create extradata from the first packet. */
+        av_freep(&st->codecpar->extradata);
+        st->codecpar->extradata_size = 0;
+
         ret = avcodec_parameters_to_context(cs->avctx, st->codecpar);
         if (ret < 0) {
             avcodec_free_context(&cs->avctx);