]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/videotoolbox: create avcC even when h264 extradata is missing
authorAman Gupta <aman@tmm1.net>
Mon, 25 Sep 2017 23:52:35 +0000 (16:52 -0700)
committerAman Gupta <aman@tmm1.net>
Mon, 13 Nov 2017 22:32:48 +0000 (14:32 -0800)
Removes the avctx->extradata_size requirement when creating avcC/hvcC, since
avctx->extradata is only used in the esds code path.

This fixes an issue where the VideoToolbox decoder would not work unless
avformat_find_stream_info() was called.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavcodec/videotoolbox.c

index c24f5aa3f399c5d2cf0f8b33d0ef472ba680d1b4..7e915a4e83b797d9f6bbaffb4804df038ffaee93 100644 (file)
@@ -702,7 +702,7 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
                          kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
                          kCFBooleanTrue);
 
-    if (avctx->extradata_size) {
+    if (1) {
         CFMutableDictionaryRef avc_info;
         CFDataRef data = NULL;
 
@@ -713,7 +713,8 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
 
         switch (codec_type) {
         case kCMVideoCodecType_MPEG4Video :
-            data = videotoolbox_esds_extradata_create(avctx);
+            if (avctx->extradata_size)
+                data = videotoolbox_esds_extradata_create(avctx);
             if (data)
                 CFDictionarySetValue(avc_info, CFSTR("esds"), data);
             break;