]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_idet.c
Merge commit 'f290e48d86e10f34b5ddc519127636bcebec7c43'
[ffmpeg] / libavfilter / vf_idet.c
index eb1303a3100d1b097805fef1ed0da3f45ae38ce8..e4fe6cbe7f4b262bf737a0045aec3856168448ab 100644 (file)
@@ -275,7 +275,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
 
     if (!idet->csp)
         idet->csp = av_pix_fmt_desc_get(link->format);
-    if (idet->csp->comp[0].depth_minus1 / 8 == 1){
+    if (idet->csp->comp[0].depth > 8){
         idet->filter_line = (ff_idet_filter_func)ff_idet_filter_line_c_16bit;
         if (ARCH_X86)
             ff_idet_init_x86(idet, 1);
@@ -313,29 +313,24 @@ static int request_frame(AVFilterLink *link)
 {
     AVFilterContext *ctx = link->src;
     IDETContext *idet = ctx->priv;
+    int ret;
 
-    do {
-        int ret;
+    if (idet->eof)
+        return AVERROR_EOF;
 
-        if (idet->eof)
-            return AVERROR_EOF;
+    ret = ff_request_frame(link->src->inputs[0]);
 
-        ret = ff_request_frame(link->src->inputs[0]);
+    if (ret == AVERROR_EOF && idet->cur && !idet->analyze_interlaced_flag_done) {
+        AVFrame *next = av_frame_clone(idet->next);
 
-        if (ret == AVERROR_EOF && idet->cur && !idet->analyze_interlaced_flag_done) {
-            AVFrame *next = av_frame_clone(idet->next);
+        if (!next)
+            return AVERROR(ENOMEM);
 
-            if (!next)
-                return AVERROR(ENOMEM);
-
-            filter_frame(link->src->inputs[0], next);
-            idet->eof = 1;
-        } else if (ret < 0) {
-            return ret;
-        }
-    } while (link->frame_requested);
+        ret = filter_frame(link->src->inputs[0], next);
+        idet->eof = 1;
+    }
 
-    return 0;
+    return ret;
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
@@ -405,12 +400,6 @@ static int query_formats(AVFilterContext *ctx)
     return ff_set_common_formats(ctx, fmts_list);
 }
 
-static int config_output(AVFilterLink *outlink)
-{
-    outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-    return 0;
-}
-
 static av_cold int init(AVFilterContext *ctx)
 {
     IDETContext *idet = ctx->priv;
@@ -445,7 +434,6 @@ static const AVFilterPad idet_outputs[] = {
     {
         .name         = "default",
         .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_output,
         .request_frame = request_frame
     },
     { NULL }