avfilter/avf_ahistogram: set time_base to outlink

And rescale timestamps.
This commit is contained in:
Paul B Mahol 2022-04-19 19:15:21 +02:00
parent b2823333d5
commit 8b717a4044
1 changed files with 2 additions and 1 deletions

View File

@ -167,6 +167,7 @@ static int config_output(AVFilterLink *outlink)
outlink->h = s->h;
outlink->sample_aspect_ratio = (AVRational){1,1};
outlink->frame_rate = s->frame_rate;
outlink->time_base = av_inv_q(outlink->frame_rate);
s->histogram_h = s->h * s->phisto;
s->ypos = s->h * s->phisto;
@ -243,7 +244,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
memset(s->out->data[2] + n * s->out->linesize[0], 127, w);
memset(s->out->data[3] + n * s->out->linesize[0], 0, w);
}
s->out->pts = in->pts;
s->out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base);
s->first = s->frame_count;