client: Stop caching media in client when doing setup
authorLinus Svensson <linussn@axis.com>
Thu, 23 Oct 2014 10:54:03 +0000 (12:54 +0200)
committerWim Taymans <wtaymans@redhat.com>
Fri, 7 Nov 2014 11:34:23 +0000 (12:34 +0100)
If the media has been managed by a session media, it should not be
cached in the client any longer. The GstRTSPSessionMedia object is now
responsible for unpreparing the GstRTSPMedia object using
gst_rtsp_media_unprepare(). Unprepare the media when finalizing the
session media.

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

gst/rtsp-server/rtsp-client.c
gst/rtsp-server/rtsp-session-media.c

index 934a3a7..c26bf6c 100644 (file)
@@ -1827,6 +1827,14 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx)
     /* if we stil have no media, error */
     if (sessmedia == NULL)
       goto sessmedia_unavailable;
+
+    /* don't cache media anymore */
+    if (priv->path)
+      g_free (priv->path);
+    priv->path = NULL;
+    if (priv->media)
+      g_object_unref (priv->media);
+    priv->media = NULL;
   } else {
     g_object_unref (media);
   }
index 8eb1f28..e319241 100644 (file)
@@ -104,6 +104,8 @@ gst_rtsp_session_media_finalize (GObject * obj)
 
   gst_rtsp_session_media_set_state (media, GST_STATE_NULL);
 
+  gst_rtsp_media_unprepare (priv->media);
+
   g_ptr_array_unref (priv->transports);
 
   g_free (priv->path);