From 6fd0b55ab2b3d42095f2eb40923609e10e8a53a5 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sat, 23 Jun 2012 12:03:00 +0200 Subject: showwaves: fix PTS computation. --- libavfilter/avf_showwaves.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavfilter') diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 90d3ec9441..121f785c15 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -202,7 +202,10 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) outlink->w, outlink->h); outpicref->video->w = outlink->w; outpicref->video->h = outlink->h; - outpicref->pts = insamples->pts; + outpicref->pts = insamples->pts + + av_rescale_q((p - (int16_t *)insamples->data[0]) / nb_channels, + (AVRational){ 1, inlink->sample_rate }, + outlink->time_base); outlink->out_buf = outpicref; linesize = outpicref->linesize[0]; memset(outpicref->data[0], 0, showwaves->h*linesize); -- cgit v1.2.3