aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-04-18 20:19:21 +0200
committerPaul B Mahol <onemda@gmail.com>2022-04-18 20:24:54 +0200
commit9f73c40d324211756ab6de3573495b5a12aeab9d (patch)
treed80383c8508b23783320750470e75c4b8412ac8d
parentd5687236aba6fd31dd4369c290df9a5b1192e43e (diff)
downloadffmpeg-9f73c40d324211756ab6de3573495b5a12aeab9d.tar.gz
avfilter/avf_showvolume: set time_base to outlink
And rescale timestamps.
-rw-r--r--libavfilter/avf_showvolume.c3
1 files changed, 2 insertions, 1 deletions
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++) {