Message ID | 20170926003631.55571-3-ffmpeg@tmm1.net |
---|---|
State | New |
Headers | show |
2017-09-26 2:36 GMT+02:00 Aman Gupta <ffmpeg@tmm1.net>: > + case kCMVideoCodecType_H264 : { > + H264Context *h = avctx->priv_data; > + if (TARGET_OS_IPHONE && h->ps.sps->frame_mbs_only_flag == 0) { I believe that for DVB 1080 transmissions the flag is never set even for progressive frames, so this has to be conditional depending on a new user option. Imo, the default should be not to abort but others may disagree. Carl Eugen
On Tue, Sep 26, 2017 at 4:20 AM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote: > 2017-09-26 2:36 GMT+02:00 Aman Gupta <ffmpeg@tmm1.net>: > > > > > + case kCMVideoCodecType_H264 : { > > > + H264Context *h = avctx->priv_data; > > > + if (TARGET_OS_IPHONE && h->ps.sps->frame_mbs_only_flag == 0) { > > > > I believe that for DVB 1080 transmissions the flag is > > never set even for progressive frames, so this has Do you know where I could find a sample of such a transmission? Aman > > to be conditional depending on a new user option. > > Imo, the default should be not to abort but others may > > disagree. > > > > Carl Eugen > > _______________________________________________ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > >
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 7dfcf14c00..8ed56392cc 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -496,11 +496,18 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec if (data) CFDictionarySetValue(avc_info, CFSTR("esds"), data); break; - case kCMVideoCodecType_H264 : + case kCMVideoCodecType_H264 : { + H264Context *h = avctx->priv_data; + if (TARGET_OS_IPHONE && h->ps.sps->frame_mbs_only_flag == 0) { + av_log(avctx, AV_LOG_ERROR, "VideoToolbox cannot decode interlaced fields on iOS\n"); + CFRelease(avc_info); + goto fail; + } data = ff_videotoolbox_avcc_extradata_create(avctx); if (data) CFDictionarySetValue(avc_info, CFSTR("avcC"), data); break; + } default: break; } @@ -515,6 +522,10 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec CFRelease(avc_info); } return config_info; + +fail: + CFRelease(config_info); + return NULL; } static CFDictionaryRef videotoolbox_buffer_attributes_create(int width,