[FFmpeg-cvslog] avfilter/avf_showvolume: set time_base to outlink
Paul B Mahol
git at videolan.org
Mon Apr 18 21:23:09 EEST 2022
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Apr 18 20:19:21 2022 +0200| [9f73c40d324211756ab6de3573495b5a12aeab9d] | committer: Paul B Mahol
avfilter/avf_showvolume: set time_base to outlink
And rescale timestamps.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f73c40d324211756ab6de3573495b5a12aeab9d
---
libavfilter/avf_showvolume.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index eb79a5ebdb..a930a1ee2a 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -213,6 +213,7 @@ static int config_output(AVFilterLink *outlink)
outlink->sample_aspect_ratio = (AVRational){1,1};
outlink->frame_rate = s->frame_rate;
+ outlink->time_base = av_inv_q(outlink->frame_rate);
for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) {
int i;
@@ -338,7 +339,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
}
clear_picture(s, outlink);
}
- s->out->pts = insamples->pts;
+ s->out->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
if ((s->f < 1.) && (s->f > 0.)) {
for (j = 0; j < outlink->h; j++) {
More information about the ffmpeg-cvslog
mailing list