client: emit new-session when new session is created
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 20 Jun 2013 10:16:07 +0000 (12:16 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 20 Jun 2013 10:16:07 +0000 (12:16 +0200)
Only emit new-session when we created a new session for a client, not when a
client picked up a previous session.

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

gst/rtsp-server/rtsp-client.c

index 39210bc..d5c7087 100644 (file)
@@ -1307,6 +1307,10 @@ handle_setup_request (GstRTSPClient * client, GstRTSPClientState * state)
     if (!(session = gst_rtsp_session_pool_create (priv->session_pool)))
       goto service_unavailable;
 
+    /* signal new session */
+    g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_NEW_SESSION], 0,
+        session);
+
     state->session = session;
 
     /* we need a new media configuration in this session */
@@ -1694,9 +1698,6 @@ client_watch_session (GstRTSPClient * client, GstRTSPSession * session)
   g_object_weak_ref (G_OBJECT (session), (GWeakNotify) client_session_finalized,
       client);
   priv->sessions = g_list_prepend (priv->sessions, session);
-
-  g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_NEW_SESSION], 0,
-      session);
 }
 
 static void