[FFmpeg-devel] [PATCH] af_amerge: compute output timestamp.

Michael Niedermayer michaelni at gmx.at
Wed May 23 13:21:46 CEST 2012


On Wed, May 23, 2012 at 01:14:56PM +0200, Nicolas George wrote:
> 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);

this may need a check for AV_NOPTS_VALUE
i did not check if theres anything that prevents pts from being
AV_NOPTS_VALUE there

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120523/e99f9328/attachment.asc>


More information about the ffmpeg-devel mailing list