summaryrefslogtreecommitdiff
path: root/libavcodec/encode.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-14 10:15:07 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-19 21:12:03 +0200
commit6118be25e15121bcd4770585900723bd9baefc9b (patch)
tree43eb1bd3790661dd55cddda59064473e31e9f18b /libavcodec/encode.c
parente392674399e19c104e5b13f37440facd7f3dcd6c (diff)
downloadffmpeg-6118be25e15121bcd4770585900723bd9baefc9b.tar.gz
lavc/encode: do not use pkt_duration for encoding
Current code prefers deprecated AVFrame.pkt_duration over its replacement AVFrame.duration whenever the former is set and not equal to the latter. However, duration will only be actually used when the caller sets the AV_CODEC_FLAG_FRAME_DURATION flag, which was added _after_ AVFrame.duration. This implies that any caller aware of AV_CODEC_FLAG_FRAME_DURATION is also aware of AVFrame.duration. pkt_duration should then never be used.
Diffstat (limited to 'libavcodec/encode.c')
-rw-r--r--libavcodec/encode.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 041fc7670e..0f11efc481 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -457,13 +457,6 @@ static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src)
finish:
-#if FF_API_PKT_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
- if (dst->pkt_duration && dst->pkt_duration != dst->duration)
- dst->duration = dst->pkt_duration;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
ret = encode_generate_icc_profile(avctx, dst);
if (ret < 0)