[FFmpeg-devel] [PATCH] af_amerge: compute output timestamp.
Nicolas George
nicolas.george at normalesup.org
Wed May 23 13:14:56 CEST 2012
Use the timestamps from the first input.
Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
libavfilter/af_amerge.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index abccfe4..623bbf7 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -216,6 +216,10 @@ 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_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;
--
1.7.10
More information about the ffmpeg-devel
mailing list