rtpbin: handle NULL demux elements
authorBlaise Gassend <blaise at willowgarage dot com>
Tue, 22 Feb 2011 12:29:26 +0000 (13:29 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 22 Feb 2011 12:31:35 +0000 (13:31 +0100)
When using gstrtpbin with ignore-pt=true, the free_stream function tries to
call gst_element_set_locked_state and gst_element_set_state on a stream->demux
which is NULL.

fixes #642412

gst/rtpmanager/gstrtpbin.c

index a2f7dc423f3a680faac752b19eeaf657d50a19c9..e8d659ff0c6962dbd5c7a23f750e09e19970f1b9 100644 (file)
@@ -1336,10 +1336,12 @@ free_stream (GstRtpBinStream * stream)
   g_signal_handler_disconnect (stream->buffer, stream->buffer_ptreq_sig);
   g_signal_handler_disconnect (stream->buffer, stream->buffer_ntpstop_sig);
 
-  gst_element_set_locked_state (stream->demux, TRUE);
+  if (stream->demux)
+    gst_element_set_locked_state (stream->demux, TRUE);
   gst_element_set_locked_state (stream->buffer, TRUE);
 
-  gst_element_set_state (stream->demux, GST_STATE_NULL);
+  if (stream->demux)
+    gst_element_set_state (stream->demux, GST_STATE_NULL);
   gst_element_set_state (stream->buffer, GST_STATE_NULL);
 
   /* now remove this signal, we need this while going to NULL because it to