appsink: unref the preroll buffer and cleanup the segments on stop()
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Fri, 14 Aug 2015 16:43:03 +0000 (18:43 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Fri, 14 Aug 2015 17:27:07 +0000 (19:27 +0200)
Just for consistency. No need to keep data around.

gst-libs/gst/app/gstappsink.c

index 4850d69..358fc86 100644 (file)
@@ -538,8 +538,11 @@ gst_app_sink_stop (GstBaseSink * psink)
   priv->flushing = TRUE;
   priv->started = FALSE;
   gst_app_sink_flush_unlocked (appsink);
+  gst_buffer_replace (&priv->preroll, NULL);
   gst_caps_replace (&priv->preroll_caps, NULL);
   gst_caps_replace (&priv->last_caps, NULL);
+  gst_segment_init (&priv->preroll_segment, GST_FORMAT_UNDEFINED);
+  gst_segment_init (&priv->last_segment, GST_FORMAT_UNDEFINED);
   g_mutex_unlock (&priv->mutex);
 
   return TRUE;