[FFmpeg-cvslog] showwaves: fix PTS computation.

Nicolas George git at videolan.org
Sat Jun 23 15:27:34 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Jun 23 12:03:00 2012 +0200| [6fd0b55ab2b3d42095f2eb40923609e10e8a53a5] | committer: Nicolas George

showwaves: fix PTS computation.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fd0b55ab2b3d42095f2eb40923609e10e8a53a5
---

 libavfilter/avf_showwaves.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index 90d3ec9..121f785 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);



More information about the ffmpeg-cvslog mailing list