Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-05-23 15:14:27 +0400
committerNicolas George <nicolas.george@normalesup.org>2012-05-23 16:56:51 +0400
commit0da28d689c37380c32f7d28b0171f24483aa3673 (patch)
tree53f3235e292d605190c774b2ecaeb642500d2a18 /libavfilter
parente6aee46760d48e3f861f1d8e893d672fa0115ef3 (diff)
af_amerge: compute output timestamp.
Use the timestamps from the first input.
Diffstat (limited to 'libavfilter')
-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;