aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/f_loop.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-07-11 10:31:47 +0200
committerAnton Khirnov <anton@khirnov.net>2022-07-19 12:27:17 +0200
commit357ba45a5ca3864b0eba07747ab6ea1614f2646b (patch)
treebfc0cb60694b7e44535d29aa21413f506ad8b149 /libavfilter/f_loop.c
parentac2cda4296dbbaf2580ec3aa404bb2f3a393159c (diff)
downloadffmpeg-357ba45a5ca3864b0eba07747ab6ea1614f2646b.tar.gz
lavfi: use AVFrame.duration instead of AVFrame.pkt_duration
Diffstat (limited to 'libavfilter/f_loop.c')
-rw-r--r--libavfilter/f_loop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavfilter/f_loop.c b/libavfilter/f_loop.c
index 672aa4c8f7..d217efe2fd 100644
--- a/libavfilter/f_loop.c
+++ b/libavfilter/f_loop.c
@@ -331,9 +331,16 @@ static int push_frame(AVFilterContext *ctx)
if (!out)
return AVERROR(ENOMEM);
out->pts += s->duration - s->start_pts;
+#if FF_API_PKT_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
if (out->pkt_duration)
duration = out->pkt_duration;
else
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ if (out->duration)
+ duration = out->duration;
+ else
duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base);
pts = out->pts + duration;
ret = ff_filter_frame(outlink, out);
@@ -368,9 +375,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return AVERROR(ENOMEM);
}
s->nb_frames++;
+#if FF_API_PKT_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
if (frame->pkt_duration)
duration = frame->pkt_duration;
else
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ if (frame->duration)
+ duration = frame->duration;
+ else
duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base);
s->duration = frame->pts + duration;
ret = ff_filter_frame(outlink, frame);