]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_idet.c
Merge commit '443b71928b2f36362e805c037751e6c3c79ea4e8'
[ffmpeg] / libavfilter / vf_idet.c
index 4532e48430009a5c97a1378cf2b90e8ddff7a1bd..5430aba628fbb5f8113e39a3c381370c98182ae1 100644 (file)
@@ -249,8 +249,19 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
         return ff_filter_frame(ctx->outputs[0], picref);
     }
 
-    if (idet->prev)
-        av_frame_free(&idet->prev);
+    av_frame_free(&idet->prev);
+
+    if(   picref->width  != link->w
+       || picref->height != link->h
+       || picref->format != link->format) {
+        link->dst->inputs[0]->format = picref->format;
+        link->dst->inputs[0]->w      = picref->width;
+        link->dst->inputs[0]->h      = picref->height;
+
+        av_frame_free(&idet->cur );
+        av_frame_free(&idet->next);
+    }
+
     idet->prev = idet->cur;
     idet->cur  = idet->next;
     idet->next = picref;
@@ -330,19 +341,20 @@ static int request_frame(AVFilterLink *link)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     IDETContext *idet = ctx->priv;
+    int level = strncmp(ctx->name, "auto-inserted", 13) ? AV_LOG_INFO : AV_LOG_DEBUG;
 
-    av_log(ctx, AV_LOG_INFO, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
+    av_log(ctx, level, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
            idet->total_repeats[REPEAT_NONE],
            idet->total_repeats[REPEAT_TOP],
            idet->total_repeats[REPEAT_BOTTOM]
         );
-    av_log(ctx, AV_LOG_INFO, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
+    av_log(ctx, level, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
            idet->total_prestat[TFF],
            idet->total_prestat[BFF],
            idet->total_prestat[PROGRESSIVE],
            idet->total_prestat[UNDETERMINED]
         );
-    av_log(ctx, AV_LOG_INFO, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
+    av_log(ctx, level, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
            idet->total_poststat[TFF],
            idet->total_poststat[BFF],
            idet->total_poststat[PROGRESSIVE],