From d0c8ca961d7d4a496f212283781ba74623bf8c3f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 25 Jan 2023 16:39:01 +0100 Subject: lavc: add a private cap for fake-delay encoders Some encoders (ffv1, flac, adx) are marked with AV_CODEC_CAP_DELAY onky in order to be flushed at the end, otherwise they behave as no-delay encoders. Add a capability to mark these encoders. Use it for setting pts generically. --- libavcodec/ffv1enc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libavcodec/ffv1enc.c') diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 0237ac48eb..6649ec7e88 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1231,8 +1231,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, f->picture_number++; pkt->size = buf_p - pkt->data; - pkt->pts = - pkt->dts = pict->pts; pkt->flags |= AV_PKT_FLAG_KEY * f->key_frame; *got_packet = 1; @@ -1301,5 +1299,5 @@ const FFCodec ff_ffv1_encoder = { }, .p.priv_class = &ffv1_class, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, }; -- cgit v1.2.3