lavc/hw_base_encode: correct the timestamp when input_order = decode_delay

Fixed the command line: ffmpeg -hwaccel vaapi -pix_fmt nv12 -s:v
widthxheight -i input.yuv -vf "hwupload" -c:v hevc_vaapi -bf 10 -b_depth 3
-vframes 3 -f null -

Signed-off-by: Tong Wu <wutong1208@outlook.com>
This commit is contained in:
Tong Wu 2024-07-08 23:13:22 +08:00 committed by Lynne
parent 2aab4e4cc0
commit 5c8523cef1

View File

@ -472,7 +472,7 @@ static int hw_base_encode_send_frame(AVCodecContext *avctx, FFHWBaseEncodeContex
// Fix timestamps if we hit end-of-stream before the initial decode
// delay has elapsed.
if (ctx->input_order < ctx->decode_delay)
if (ctx->input_order <= ctx->decode_delay)
ctx->dts_pts_diff = ctx->pic_end->pts - ctx->first_pts;
}