[FFmpeg-cvslog] avfilter/af_amix: set output frame duration

Paul B Mahol git at videolan.org
Tue Nov 28 14:15:20 EET 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Nov 28 13:05:49 2023 +0100| [bafbb0697e05e78aca5b3eccc9c64fca8f05249b] | committer: Paul B Mahol

avfilter/af_amix: set output frame duration

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

 libavfilter/af_amix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 120a97f48c..39353d6642 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -379,6 +379,9 @@ static int output_frame(AVFilterLink *outlink)
     av_frame_free(&in_buf);
 
     out_buf->pts = s->next_pts;
+    out_buf->duration = av_rescale_q(out_buf->nb_samples, av_make_q(1, outlink->sample_rate),
+                                     outlink->time_base);
+
     if (s->next_pts != AV_NOPTS_VALUE)
         s->next_pts += nb_samples;
 



More information about the ffmpeg-cvslog mailing list