From 989f004e24e6e6e8d8a0a041849d9ce593403666 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 20 Nov 2012 09:42:51 +0100 Subject: [PATCH] media: unref source in finish_unprepare The source is created in prepare, unref it in finish_unprepare. See https://bugzilla.gnome.org/show_bug.cgi?id=688707 --- gst/rtsp-server/rtsp-media.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index d8191bbf24..979ba826eb 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -171,10 +171,6 @@ gst_rtsp_media_finalize (GObject * obj) g_list_free_full (media->dynamic, gst_object_unref); - if (media->source) { - g_source_destroy (media->source); - g_source_unref (media->source); - } if (media->auth) g_object_unref (media->auth); if (media->pool) @@ -1339,6 +1335,12 @@ finish_unprepare (GstRTSPMedia * media) media->reused = TRUE; media->status = GST_RTSP_MEDIA_STATUS_UNPREPARED; + if (media->source) { + g_source_destroy (media->source); + g_source_unref (media->source); + media->source = NULL; + } + /* when the media is not reusable, this will effectively unref the media and * recreate it */ g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_UNPREPARED], 0, NULL); @@ -1395,11 +1397,6 @@ gst_rtsp_media_unprepare (GstRTSPMedia * media) } else { finish_unprepare (media); } - if (media->source) { - g_source_destroy (media->source); - g_source_unref (media->source); - media->source = NULL; - } g_rec_mutex_unlock (&media->state_lock); return success;