[FFmpeg-cvslog] af_amerge: compute output timestamp.

Nicolas George git at videolan.org
Wed May 23 15:13:34 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed May 23 13:14:27 2012 +0200| [0da28d689c37380c32f7d28b0171f24483aa3673] | committer: Nicolas George

af_amerge: compute output timestamp.

Use the timestamps from the first input.

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

 libavfilter/af_amerge.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index abccfe4..27a35a8 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -216,6 +216,11 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
         ins[i] = (*inbuf[i])->data[0] +
                  am->queue[i].pos * am->nb_in_ch[i] * am->bps;
     }
+    outbuf->pts = (*inbuf[0])->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
+                  (*inbuf[0])->pts +
+                  av_rescale_q(am->queue[0].pos,
+                               (AVRational){ 1, ctx->inputs[0]->sample_rate },
+                               ctx->outputs[0]->time_base);
 
     avfilter_copy_buffer_ref_props(outbuf, *inbuf[0]);
     outbuf->audio->nb_samples     = nb_samples;



More information about the ffmpeg-cvslog mailing list