hlsdemux: stop the fetcher in the PAUSED_TO_READY transition, not when disposing()
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Tue, 15 Feb 2011 02:41:43 +0000 (03:41 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 30 Mar 2011 07:19:21 +0000 (09:19 +0200)
gst/hls/gsthlsdemux.c

index 4dc5cd363479d90ac4c9f85a5ffe3accab3f5907..173ca2bf6aebaae4c93241a57f0d348555e7bc90 100644 (file)
@@ -139,7 +139,6 @@ gst_hls_demux_dispose (GObject * obj)
 {
   GstHLSDemux *demux = GST_HLS_DEMUX (obj);
 
-  gst_hls_demux_stop_fetcher (demux, TRUE);
   g_cond_free (demux->fetcher_cond);
   g_mutex_free (demux->fetcher_lock);
 
@@ -296,6 +295,14 @@ gst_hls_demux_change_state (GstElement * element, GstStateChange transition)
   }
 
   ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+  switch (transition) {
+    case GST_STATE_CHANGE_PAUSED_TO_READY:
+      gst_hls_demux_stop_fetcher (demux, TRUE);
+      break;
+    default:
+      break;
+  }
   return ret;
 }