summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolbox.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2017-09-25 16:52:35 -0700
committerAman Gupta <aman@tmm1.net>2017-11-13 14:32:48 -0800
commit403d10a8b3cd9c0c9a4a034b95a4cb5ffc4b1112 (patch)
tree71220a6f9d9b3c9749c48073c49b78c069ebf8e7 /libavcodec/videotoolbox.c
parent9519983c0f39d01fd86544dc56adbbf15bdd3c3c (diff)
avcodec/videotoolbox: create avcC even when h264 extradata is missing
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>
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index c24f5aa3f3..7e915a4e83 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -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;