Commit 06267afe authored by Benjamin Steffes's avatar Benjamin Steffes Committed by Carl Eugen Hoyos

Fix detelecine filter for patterns like 3444 or 33333334.

Signed-off-by: 's avatarBenjamin Steffes <benjaminst123@gmail.com>
Signed-off-by: 's avatarCarl Eugen Hoyos <cehoyos@ag.or.at>
parent 50ef7361
...@@ -195,11 +195,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) ...@@ -195,11 +195,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
s->nskip_fields -= 2; s->nskip_fields -= 2;
return 0; return 0;
} else if (s->nskip_fields >= 1) { } else if (s->nskip_fields >= 1) {
if (s->occupied) {
s->occupied = 0;
s->nskip_fields--;
}
else {
for (i = 0; i < s->nb_planes; i++) { for (i = 0; i < s->nb_planes; i++) {
av_image_copy_plane(s->temp->data[i], s->temp->linesize[i], av_image_copy_plane(s->temp->data[i], s->temp->linesize[i],
inpicref->data[i], inpicref->linesize[i], inpicref->data[i], inpicref->linesize[i],
...@@ -210,7 +205,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) ...@@ -210,7 +205,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
s->nskip_fields--; s->nskip_fields--;
return 0; return 0;
} }
}
if (s->nskip_fields == 0) { if (s->nskip_fields == 0) {
while(!len && s->pattern[s->pattern_pos]) { while(!len && s->pattern[s->pattern_pos]) {
...@@ -243,7 +237,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) ...@@ -243,7 +237,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
s->stride[i], s->stride[i],
(s->planeheight[i] - !s->first_field + 1) / 2); (s->planeheight[i] - !s->first_field + 1) / 2);
} }
len -= 2;
s->occupied = 0;
if (len <= 2) {
for (i = 0; i < s->nb_planes; i++) { for (i = 0; i < s->nb_planes; i++) {
av_image_copy_plane(s->temp->data[i], s->temp->linesize[i], av_image_copy_plane(s->temp->data[i], s->temp->linesize[i],
inpicref->data[i], inpicref->linesize[i], inpicref->data[i], inpicref->linesize[i],
...@@ -251,7 +247,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) ...@@ -251,7 +247,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
s->planeheight[i]); s->planeheight[i]);
} }
s->occupied = 1; s->occupied = 1;
}
out = 1; out = 1;
len = (len >= 3) ? len - 3 : 0;
} else { } else {
if (len >= 2) { if (len >= 2) {
// output THIS image as-is // output THIS image as-is
......
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