mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 02:04:58 +00:00
af_amerge: compute output timestamp.
Use the timestamps from the first input.
This commit is contained in:
parent
e6aee46760
commit
0da28d689c
@ -216,6 +216,11 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
|||||||
ins[i] = (*inbuf[i])->data[0] +
|
ins[i] = (*inbuf[i])->data[0] +
|
||||||
am->queue[i].pos * am->nb_in_ch[i] * am->bps;
|
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]);
|
avfilter_copy_buffer_ref_props(outbuf, *inbuf[0]);
|
||||||
outbuf->audio->nb_samples = nb_samples;
|
outbuf->audio->nb_samples = nb_samples;
|
||||||
|
Loading…
Reference in New Issue
Block a user