Browse code

lavfi/hqdn3d: restore timeline feature.

Clément Bœsch authored on 2013/05/09 08:13:59
Showing 1 changed files
... ...
@@ -274,13 +274,14 @@ static int config_input(AVFilterLink *inlink)
274 274
 
275 275
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
276 276
 {
277
-    HQDN3DContext *hqdn3d = inlink->dst->priv;
278
-    AVFilterLink *outlink = inlink->dst->outputs[0];
277
+    AVFilterContext *ctx  = inlink->dst;
278
+    HQDN3DContext *hqdn3d = ctx->priv;
279
+    AVFilterLink *outlink = ctx->outputs[0];
279 280
 
280 281
     AVFrame *out;
281 282
     int direct, c;
282 283
 
283
-    if (av_frame_is_writable(in)) {
284
+    if (av_frame_is_writable(in) && !ctx->is_disabled) {
284 285
         direct = 1;
285 286
         out = in;
286 287
     } else {
... ...
@@ -304,6 +305,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
304 304
                 hqdn3d->coefs[c ? CHROMA_TMP     : LUMA_TMP]);
305 305
     }
306 306
 
307
+    if (ctx->is_disabled) {
308
+        av_frame_free(&out);
309
+        return ff_filter_frame(outlink, in);
310
+    }
311
+
307 312
     if (!direct)
308 313
         av_frame_free(&in);
309 314
 
... ...
@@ -358,4 +364,5 @@ AVFilter avfilter_vf_hqdn3d = {
358 358
 
359 359
     .inputs    = avfilter_vf_hqdn3d_inputs,
360 360
     .outputs   = avfilter_vf_hqdn3d_outputs,
361
+    .flags     = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
361 362
 };