diff mbox series

[FFmpeg-devel,05/36] fftools/ffmpeg_filter: make sure pkt_duration matches duration

Message ID 20230517102029.541-5-anton@khirnov.net
State Accepted
Commit 113250732723f1a2b695c64cdc03e5bf0f1311a4
Headers show
Series [FFmpeg-devel,01/36] fftools/ffmpeg: shorten a variable name | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Anton Khirnov May 17, 2023, 10:19 a.m. UTC
Otherwise the two values might get desynchronized and lavfi can prefer
the wrong one.
---
 fftools/ffmpeg_filter.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 95ffa0f087..274eefe11c 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1622,6 +1622,11 @@  int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference)
     frame->pts       = av_rescale_q(frame->pts,      frame->time_base, ifp->time_base);
     frame->duration  = av_rescale_q(frame->duration, frame->time_base, ifp->time_base);
     frame->time_base = ifp->time_base;
+#if LIBAVUTIL_VERSION_MAJOR < 59
+    AV_NOWARN_DEPRECATED(
+    frame->pkt_duration = frame->duration;
+    )
+#endif
 
     ret = av_buffersrc_add_frame_flags(ifilter->filter, frame,
                                        AV_BUFFERSRC_FLAG_PUSH);