rtsp-media: Take reference to media that will be prepared
authorSebastian Rasmussen <sebras@hotmail.com>
Mon, 28 Sep 2015 15:40:59 +0000 (17:40 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 29 Sep 2015 10:23:06 +0000 (11:23 +0100)
commit6f1cad9237956235e5cf326c1e6394e5ae39433a
tree6f1aae93a56dc0c36e04d893c476aa1b7be98cc8
parent6d20a1c9d91fb245885de11b032df975858b8151
rtsp-media: Take reference to media that will be prepared

default_prepare() takes a transfer-none reference GstRTSPMedia object.
Later on a g_idle_source_new() is created and a pointer to the media
object is passed as user data. If the media is freed before the idle
source is dispatched the media object pointer is invalid, but the idle
source callback expects it to still be valid. To fix this a reference to
the media object is taken when registering the source callback function
and a corresponding release of the reference is done when the souce is
destroyed.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755748
gst/rtsp-server/rtsp-media.c