media: stop thread if media is already prepared
authorAleix Conchillo FlaquƩ <aleix@oblong.com>
Tue, 11 Feb 2014 22:20:39 +0000 (14:20 -0800)
committerWim Taymans <wtaymans@redhat.com>
Tue, 18 Feb 2014 10:02:24 +0000 (11:02 +0100)
in gst_rtsp_media_prepare() the thread is not used if media is already
prepared (e.g. media shared) so we want to stop the thread. otherwise, a
leak occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=724182

gst/rtsp-server/rtsp-media.c

index 69ecded..033e973 100644 (file)
@@ -2204,6 +2204,8 @@ wait_status:
 was_prepared:
   {
     GST_LOG ("media %p was prepared", media);
+    /* we are not going to use the giving thread, so stop it. */
+    gst_rtsp_thread_stop (thread);
     g_rec_mutex_unlock (&priv->state_lock);
     return TRUE;
   }