mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-14 04:17:39 +02:00
avcodec/videotoolboxenc: Fixes non-B-Frame encoding
Sets vtctx->has_b_frames to 0 if the VideoToolbox compression session will not emit B-frames (and, in consequence, no valid DTSs). Required for the handling of invalid DTSs in 'vtenc_cm_to_avpacket' (line 2018ff) to work correctly and not abort encoding with "DTS is invalid." when no B-frames are generated. Signed-off-by: NoHalfBits <ffmpeg-devel@fluthaus.com> Signed-off-by: Rick Kern <kernrj@gmail.com>
This commit is contained in:
parent
90546c6ca7
commit
b786bc7433
@ -1516,7 +1516,10 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
|
|||||||
if (!status && has_b_frames_cfbool) {
|
if (!status && has_b_frames_cfbool) {
|
||||||
//Some devices don't output B-frames for main profile, even if requested.
|
//Some devices don't output B-frames for main profile, even if requested.
|
||||||
// HEVC has b-pyramid
|
// HEVC has b-pyramid
|
||||||
vtctx->has_b_frames = (CFBooleanGetValue(has_b_frames_cfbool) && avctx->codec_id == AV_CODEC_ID_HEVC) ? 2 : 1;
|
if (CFBooleanGetValue(has_b_frames_cfbool))
|
||||||
|
vtctx->has_b_frames = avctx->codec_id == AV_CODEC_ID_HEVC ? 2 : 1;
|
||||||
|
else
|
||||||
|
vtctx->has_b_frames = 0;
|
||||||
CFRelease(has_b_frames_cfbool);
|
CFRelease(has_b_frames_cfbool);
|
||||||
}
|
}
|
||||||
avctx->has_b_frames = vtctx->has_b_frames;
|
avctx->has_b_frames = vtctx->has_b_frames;
|
||||||
|
Loading…
Reference in New Issue
Block a user