diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-04-18 20:19:21 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-04-18 20:24:54 +0200 |
commit | 9f73c40d324211756ab6de3573495b5a12aeab9d (patch) | |
tree | d80383c8508b23783320750470e75c4b8412ac8d | |
parent | d5687236aba6fd31dd4369c290df9a5b1192e43e (diff) | |
download | ffmpeg-9f73c40d324211756ab6de3573495b5a12aeab9d.tar.gz |
avfilter/avf_showvolume: set time_base to outlink
And rescale timestamps.
-rw-r--r-- | libavfilter/avf_showvolume.c | 3 |
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++) { |