diff options
author | Aman Gupta <aman@tmm1.net> | 2017-11-10 11:52:38 -0800 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2017-11-13 14:32:48 -0800 |
commit | bd2d70c0b8f416cf1f70e910ed675c0d46fb0010 (patch) | |
tree | 800b2058031ca94f937a8afcb9244095ae4a90b9 | |
parent | 403d10a8b3cd9c0c9a4a034b95a4cb5ffc4b1112 (diff) | |
download | ffmpeg-bd2d70c0b8f416cf1f70e910ed675c0d46fb0010.tar.gz |
avcodec/videotoolbox: remove unnecessary if statement
Cosmetic change only.
Signed-off-by: Aman Gupta <aman@tmm1.net>
-rw-r--r-- | libavcodec/videotoolbox.c | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 7e915a4e83..1307e93bcc 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -702,45 +702,43 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder, kCFBooleanTrue); - if (1) { - CFMutableDictionaryRef avc_info; - CFDataRef data = NULL; - - avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault, - 1, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - switch (codec_type) { - case kCMVideoCodecType_MPEG4Video : - if (avctx->extradata_size) - data = videotoolbox_esds_extradata_create(avctx); - if (data) - CFDictionarySetValue(avc_info, CFSTR("esds"), data); - break; - case kCMVideoCodecType_H264 : - data = ff_videotoolbox_avcc_extradata_create(avctx); - if (data) - CFDictionarySetValue(avc_info, CFSTR("avcC"), data); - break; - case kCMVideoCodecType_HEVC : - data = ff_videotoolbox_hvcc_extradata_create(avctx); - if (data) - CFDictionarySetValue(avc_info, CFSTR("hvcC"), data); - break; - default: - break; - } + CFMutableDictionaryRef avc_info; + CFDataRef data = NULL; - CFDictionarySetValue(config_info, - kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, - avc_info); + avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault, + 1, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + switch (codec_type) { + case kCMVideoCodecType_MPEG4Video : + if (avctx->extradata_size) + data = videotoolbox_esds_extradata_create(avctx); if (data) - CFRelease(data); - - CFRelease(avc_info); + CFDictionarySetValue(avc_info, CFSTR("esds"), data); + break; + case kCMVideoCodecType_H264 : + data = ff_videotoolbox_avcc_extradata_create(avctx); + if (data) + CFDictionarySetValue(avc_info, CFSTR("avcC"), data); + break; + case kCMVideoCodecType_HEVC : + data = ff_videotoolbox_hvcc_extradata_create(avctx); + if (data) + CFDictionarySetValue(avc_info, CFSTR("hvcC"), data); + break; + default: + break; } + + CFDictionarySetValue(config_info, + kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, + avc_info); + + if (data) + CFRelease(data); + + CFRelease(avc_info); return config_info; } |