fieldanalysis: Don't reset the context on DISCONT
authorRobert Swain <robert.swain@collabora.co.uk>
Fri, 28 Oct 2011 09:10:06 +0000 (11:10 +0200)
committerRobert Swain <robert.swain@collabora.co.uk>
Mon, 31 Oct 2011 17:20:32 +0000 (18:20 +0100)
On discont, the queue of frames was being cleared, but also the
context reset. We only need to clear the queue.

gst/fieldanalysis/gstfieldanalysis.c

index 7f8a059..3cfd5c8 100644 (file)
@@ -313,9 +313,8 @@ static guint64 block_score_for_row_5_tap (GstFieldAnalysis * filter,
 static gfloat opposite_parity_windowed_comb (GstFieldAnalysis * filter,
     FieldAnalysisFields * fields);
 
-
 static void
-gst_field_analysis_reset (GstFieldAnalysis * filter)
+gst_field_analysis_empty_queue (GstFieldAnalysis * filter)
 {
   if (filter->frames) {
     guint length = g_queue_get_length (filter->frames);
@@ -327,6 +326,12 @@ gst_field_analysis_reset (GstFieldAnalysis * filter)
       length--;
     }
   }
+}
+
+static void
+gst_field_analysis_reset (GstFieldAnalysis * filter)
+{
+  gst_field_analysis_empty_queue (filter);
   GST_DEBUG_OBJECT (filter, "Resetting context");
   memset (filter->results, 0, 2 * sizeof (FieldAnalysis));
   filter->is_telecine = FALSE;
@@ -1711,7 +1716,7 @@ gst_field_analysis_chain (GstPad * pad, GstBuffer * buf)
       }
     }
 
-    gst_field_analysis_reset (filter);
+    gst_field_analysis_empty_queue (filter);
 
     if (ret != GST_FLOW_OK) {
       GST_DEBUG_OBJECT (filter,