[FFmpeg-cvslog] avfilter/phase: add timeline support.

Clément Bœsch git at videolan.org
Thu May 8 23:58:49 CEST 2014


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat May  3 22:43:20 2014 +0200| [69d72140accb8f6e61f046fa5b91f0f9c2f52f22] | committer: Clément Bœsch

avfilter/phase: add timeline support.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69d72140accb8f6e61f046fa5b91f0f9c2f52f22
---

 libavfilter/vf_phase.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index dd3eced..297ef70 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -243,6 +243,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     int plane, top, y;
     AVFrame *out;
 
+    if (ctx->is_disabled) {
+        av_frame_free(&s->frame);
+        /* we keep a reference to the previous frame so the filter can start
+         * being useful as soon as it's not disabled, avoiding the 1-frame
+         * delay. */
+        s->frame = av_frame_clone(in);
+        return ff_filter_frame(outlink, in);
+    }
+
     out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     if (!out) {
         av_frame_free(&in);
@@ -311,4 +320,5 @@ AVFilter ff_vf_phase = {
     .query_formats = query_formats,
     .inputs        = phase_inputs,
     .outputs       = phase_outputs,
+    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
 };



More information about the ffmpeg-cvslog mailing list