factory: plug pad leak in collect_streams

In gst_rtsp_media_factory_collect_streams: unref the srcpad that
was retrieved using gst_element_get_static_pad. gst_ghost_pad_new
will take one reference, and the other reference will otherwise
give a memory leak.
This commit is contained in:
David Svensson Fors 2012-06-12 13:36:57 +02:00 committed by Wim Taymans
parent ef29cc6d78
commit aa158fa738

View file

@ -750,6 +750,7 @@ gst_rtsp_media_factory_collect_streams (GstRTSPMediaFactory * factory,
/* ghost the pad of the payloader to the element */ /* ghost the pad of the payloader to the element */
stream->srcpad = gst_ghost_pad_new (name, pad); stream->srcpad = gst_ghost_pad_new (name, pad);
g_object_unref (pad);
gst_pad_set_active (stream->srcpad, TRUE); gst_pad_set_active (stream->srcpad, TRUE);
gst_element_add_pad (media->element, stream->srcpad); gst_element_add_pad (media->element, stream->srcpad);
gst_object_unref (elem); gst_object_unref (elem);