[FFmpeg-devel] [PATCH] avfilter: add loop filters

Michael Niedermayer michael at niedermayer.cc
Fri Feb 12 14:47:54 CET 2016


On Thu, Feb 11, 2016 at 11:11:49PM +0100, Paul B Mahol wrote:
> Hi,
> 
> patch attached.

>  Makefile     |    2 
>  allfilters.c |    2 
>  f_loop.c     |  220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 224 insertions(+)
> 9acd18c6b2dff1cc2c1b5d5e9cfcc94760a02821  0001-avfilter-add-loop-filters.patch
> From 1fd9636e9040b2a6b321cdd16ebd392c8db2de1b Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda at gmail.com>
> Date: Thu, 11 Feb 2016 22:05:54 +0100
> Subject: [PATCH] avfilter: add loop filters
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
[...]

> +static int push_frame(AVFilterContext *ctx)
> +{
> +    AVFilterLink *outlink = ctx->outputs[0];
> +    LoopContext *s = ctx->priv;
> +    int64_t pts;
> +    int ret;
> +
> +    AVFrame *out = av_frame_clone(s->frames[s->current_frame]);
> +
> +    if (!out)
> +        return AVERROR(ENOMEM);
> +    out->pts += s->duration - s->start_pts;

> +    pts = out->pts + out->pkt_duration;

[...]

> +            s->duration = frame->pts + frame->pkt_duration;

This shoudl use av_frame_get_pkt_duration()

    /**
     * duration of the corresponding packet, expressed in
     * AVStream->time_base units, 0 if unknown.
     * Code outside libavutil should access this field using:
     * av_frame_get_pkt_duration(frame)



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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160212/37b5f2b3/attachment.sig>


More information about the ffmpeg-devel mailing list