Commit dd5d6179 authored by Neil Birkbeck's avatar Neil Birkbeck Committed by Michael Niedermayer

avfilter/vf_idet: Fixing idet for single-frame inputs.

Handle single frame inputs similar to yadif (e.g., https://github.com/FFmpeg/FFmpeg/commit/0f9f24c9cfd291c7ece4d3bad64fdf06d107168a and https://github.com/FFmpeg/FFmpeg/commit/681e008d06d2241d50abe6316c908a184ddc5942)

Example:
  ffmpeg -r 1 -t 1 -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm  -vf idet,showinfo -f null -y /dev/null

Previously:
  Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
  [Parsed_idet_0 @ 0x36389d0] Repeated Fields: Neither:     0 Top:     0 Bottom:     0

After patch:
  [Parsed_showinfo_1 @ 0x1909810] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 ...
  [Parsed_idet_0 @ 0x18f9bb0] Repeated Fields: Neither:     1 Top:     0 Bottom:     0

Fate looks good.
Signed-off-by: 's avatarNeil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 27897d2e
...@@ -241,11 +241,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) ...@@ -241,11 +241,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
idet->cur = idet->next; idet->cur = idet->next;
idet->next = picref; idet->next = picref;
if (!idet->cur) if (!idet->cur &&
return 0; !(idet->cur = av_frame_clone(idet->next)))
return AVERROR(ENOMEM);
if (!idet->prev) if (!idet->prev)
idet->prev = av_frame_clone(idet->cur); return 0;
if (!idet->csp) if (!idet->csp)
idet->csp = av_pix_fmt_desc_get(link->format); idet->csp = av_pix_fmt_desc_get(link->format);
...@@ -284,7 +285,7 @@ static int request_frame(AVFilterLink *link) ...@@ -284,7 +285,7 @@ static int request_frame(AVFilterLink *link)
} else if (ret < 0) { } else if (ret < 0) {
return ret; return ret;
} }
} while (!idet->cur); } while (!idet->prev);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment