aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-05-23 13:14:27 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-05-23 14:56:51 +0200
commit0da28d689c37380c32f7d28b0171f24483aa3673 (patch)
tree53f3235e292d605190c774b2ecaeb642500d2a18
parente6aee46760d48e3f861f1d8e893d672fa0115ef3 (diff)
downloadffmpeg-0da28d689c37380c32f7d28b0171f24483aa3673.tar.gz
af_amerge: compute output timestamp.
Use the timestamps from the first input.
-rw-r--r--libavfilter/af_amerge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index abccfe4e29..27a35a8cba 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;