[FFmpeg-cvslog] lavf: use AVFrame.duration instead of AVFrame.pkt_duration

Anton Khirnov git at videolan.org
Tue Jul 19 13:36:46 EEST 2022


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Jul 11 10:31:47 2022 +0200| [7d9ee6741c53a2ea9f3a5559c32320b731a8d80a] | committer: Anton Khirnov

lavf: use AVFrame.duration instead of AVFrame.pkt_duration

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d9ee6741c53a2ea9f3a5559c32320b731a8d80a
---

 libavformat/mux.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 31361f9b46..a3b50dadb6 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1417,7 +1417,14 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
         pkt->size         = sizeof(frame);
         pkt->pts          =
         pkt->dts          = frame->pts;
-        pkt->duration     = frame->pkt_duration;
+#if FF_API_PKT_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
+        if (frame->pkt_duration)
+            pkt->duration     = frame->pkt_duration;
+        else
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+        pkt->duration = frame->duration;
         pkt->stream_index = stream_index;
         pkt->flags |= AV_PKT_FLAG_UNCODED_FRAME;
     }



More information about the ffmpeg-cvslog mailing list