interlace: Clear stored_fields together with stored_frame
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Wed, 20 Oct 2021 22:35:00 +0000 (00:35 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 21 Oct 2021 10:50:17 +0000 (10:50 +0000)
These fields belong together.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1039>

subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c

index 62bbf30..569a425 100644 (file)
@@ -321,6 +321,7 @@ gst_interlace_reset (GstInterlace * interlace)
   if (interlace->stored_frame) {
     gst_buffer_unref (interlace->stored_frame);
     interlace->stored_frame = NULL;
+    interlace->stored_fields = 0;
   }
 }
 
@@ -685,6 +686,7 @@ gst_interlace_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
       if (interlace->stored_frame) {
         gst_buffer_unref (interlace->stored_frame);
         interlace->stored_frame = NULL;
+        interlace->stored_fields = 0;
       }
       ret = gst_pad_push_event (interlace->srcpad, event);
       break;
@@ -1238,9 +1240,9 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
 
     if (interlace->stored_frame) {
       gst_buffer_unref (interlace->stored_frame);
+      interlace->stored_frame = NULL;
+      interlace->stored_fields = 0;
     }
-    interlace->stored_frame = NULL;
-    interlace->stored_fields = 0;
 
     if (interlace->top_field_first) {
       interlace->field_index = 0;