deinterlace: fix infinite loop on EOS with non-default methods or fields
authorKishore Arepalli <kishore.arepalli@gmail.com>
Thu, 14 Mar 2013 13:12:05 +0000 (14:12 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Sun, 17 Mar 2013 14:47:26 +0000 (14:47 +0000)
Fixes problem of infinite loop in gst_deinterlace_reset_history.
Last field in the history was never deinterlaced because idx becomes negative.

Happens e.g. with method=scalerbob fields=bottom or
method=greedyl fields=top

https://bugzilla.gnome.org/show_bug.cgi?id=695644
https://bugzilla.gnome.org/show_bug.cgi?id=693173

gst/deinterlace/gstdeinterlace.c

index 240cbdb..9f59463 100644 (file)
@@ -1708,6 +1708,8 @@ restart:
 
   if (!flushing && self->cur_field_idx < 1) {
     goto need_more;
+  } else if (self->cur_field_idx < 0 && flushing) {
+    self->cur_field_idx++;
   }
 
   if (self->fields == GST_DEINTERLACE_ALL || IS_TELECINE (interlacing_mode))