mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
Unref pipeline and set it to NULL. Set stream's caps to NULL, otherwise we unref it too often.
This commit is contained in:
parent
036550bf60
commit
f384231ca3
1 changed files with 6 additions and 2 deletions
|
@ -142,13 +142,13 @@ gst_rtsp_media_finalize (GObject * obj)
|
||||||
media = GST_RTSP_MEDIA (obj);
|
media = GST_RTSP_MEDIA (obj);
|
||||||
|
|
||||||
g_message ("finalize media %p", media);
|
g_message ("finalize media %p", media);
|
||||||
/*
|
|
||||||
if (media->pipeline) {
|
if (media->pipeline) {
|
||||||
unlock_streams (media);
|
unlock_streams (media);
|
||||||
gst_element_set_state (media->pipeline, GST_STATE_NULL);
|
gst_element_set_state (media->pipeline, GST_STATE_NULL);
|
||||||
gst_object_unref (media->pipeline);
|
gst_object_unref (media->pipeline);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
for (i = 0; i < media->streams->len; i++) {
|
for (i = 0; i < media->streams->len; i++) {
|
||||||
GstRTSPMediaStream *stream;
|
GstRTSPMediaStream *stream;
|
||||||
|
|
||||||
|
@ -1576,11 +1576,15 @@ 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]);
|
||||||
}
|
}
|
||||||
|
stream->caps = NULL;
|
||||||
gst_rtsp_media_stream_free (stream);
|
gst_rtsp_media_stream_free (stream);
|
||||||
}
|
}
|
||||||
g_array_remove_range (media->streams, 0, media->streams->len);
|
g_array_remove_range (media->streams, 0, media->streams->len);
|
||||||
|
|
||||||
gst_element_set_state (media->rtpbin, GST_STATE_NULL);
|
gst_element_set_state (media->rtpbin, GST_STATE_NULL);
|
||||||
gst_bin_remove (GST_BIN (media->pipeline), media->rtpbin);
|
gst_bin_remove (GST_BIN (media->pipeline), media->rtpbin);
|
||||||
|
|
||||||
|
gst_object_unref (media->pipeline);
|
||||||
|
media->pipeline = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue