media: Fixed crasher where caps got unref'ed too often

This commit is contained in:
Sebastian Pölsterl 2009-10-09 23:08:18 +02:00 committed by Wim Taymans
parent 7d38b37ae6
commit f8630c6c81

View file

@ -1569,6 +1569,8 @@ gst_rtsp_media_remove_elements (GstRTSPMedia *media)
gst_pad_unlink (stream->srcpad, stream->send_rtp_sink); gst_pad_unlink (stream->srcpad, stream->send_rtp_sink);
g_signal_handler_disconnect (stream->send_rtp_sink, stream->caps_sig);
for (j = 0; j < 2; j++) { for (j = 0; j < 2; j++) {
gst_element_set_state (stream->udpsrc[j], GST_STATE_NULL); gst_element_set_state (stream->udpsrc[j], GST_STATE_NULL);
gst_element_set_state (stream->udpsink[j], GST_STATE_NULL); gst_element_set_state (stream->udpsink[j], GST_STATE_NULL);
@ -1584,6 +1586,8 @@ gst_rtsp_media_remove_elements (GstRTSPMedia *media)
gst_bin_remove (GST_BIN (media->pipeline), stream->tee[j]); gst_bin_remove (GST_BIN (media->pipeline), stream->tee[j]);
gst_bin_remove (GST_BIN (media->pipeline), stream->selector[j]); gst_bin_remove (GST_BIN (media->pipeline), stream->selector[j]);
} }
if (stream->caps)
gst_caps_unref (stream->caps);
stream->caps = NULL; stream->caps = NULL;
gst_rtsp_media_stream_free (stream); gst_rtsp_media_stream_free (stream);
} }