rtsp-server: Fix compilation and compiler warnings
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 13 Apr 2012 13:27:22 +0000 (15:27 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 13 Apr 2012 13:27:22 +0000 (15:27 +0200)
gst/rtsp-server/rtsp-auth.c
gst/rtsp-server/rtsp-auth.h
gst/rtsp-server/rtsp-client.c

index e01315c..1165677 100644 (file)
@@ -189,7 +189,7 @@ default_check_method (GstRTSPAuth * auth, GstRTSPClient * client,
   gboolean result = TRUE;
   GstRTSPResult res;
 
-  if (state->method & auth->methods != 0) {
+  if ((state->method & auth->methods) != 0) {
     gchar *authorization;
 
     result = FALSE;
@@ -221,7 +221,7 @@ no_auth:
 }
 
 /**
- * gst_rtsp_auth_check_method:
+ * gst_rtsp_auth_check:
  * @auth: a #GstRTSPAuth
  * @client: the client
  * @hint: a hint
index 3aadeff..5f06acb 100644 (file)
@@ -70,7 +70,7 @@ void                gst_rtsp_auth_set_basic         (GstRTSPAuth *auth, const gc
 
 gboolean            gst_rtsp_auth_setup_auth        (GstRTSPAuth *auth, GstRTSPClient * client,
                                                      GQuark hint, GstRTSPClientState *state);
-gboolean            gst_rtsp_auth_check_method      (GstRTSPAuth *auth, GstRTSPClient * client,
+gboolean            gst_rtsp_auth_check             (GstRTSPAuth *auth, GstRTSPClient * client,
                                                      GQuark hint, GstRTSPClientState *state);
 /* helpers */
 gchar *             gst_rtsp_auth_make_basic        (const gchar * user, const gchar * pass);
index f814c51..8c08fd1 100644 (file)
@@ -429,7 +429,7 @@ do_send_data_list (GstBufferList * blist, guint8 channel,
 {
   guint len, i;
 
-  len = gst_buffer_list_len (blist);
+  len = gst_buffer_list_length (blist);
 
   for (i = 0; i < len; i++) {
     GstBuffer *group = gst_buffer_list_get (blist, i);
@@ -1351,7 +1351,7 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request)
   state.session = session;
 
   if (client->auth) {
-    if (!gst_rtsp_auth_check (client->auth, client, &state))
+    if (!gst_rtsp_auth_check (client->auth, client, 0, &state))
       goto not_authorized;
   }
 
@@ -1433,9 +1433,7 @@ handle_data (GstRTSPClient * client, GstRTSPMessage * message)
 
   gst_rtsp_message_steal_body (message, &data, &size);
 
-  buffer = gst_buffer_new ();
-  gst_buffer_take_memory (buffer, -1,
-      gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
+  buffer = gst_buffer_new_wrapped (data, size);
 
   handled = FALSE;
   for (walk = client->streams; walk; walk = g_list_next (walk)) {
@@ -1849,20 +1847,20 @@ tunnel_complete (GstRTSPWatch * watch, gpointer user_data)
 no_tunnelid:
   {
     GST_INFO ("client %p: no tunnelid provided", client);
-    return GST_RTSP_STS_SERVICE_UNAVAILABLE;
+    return GST_RTSP_ERROR;
   }
 no_tunnel:
   {
     g_mutex_unlock (tunnels_lock);
     GST_INFO ("client %p: tunnel session %s not found", client, tunnelid);
-    return GST_RTSP_STS_SERVICE_UNAVAILABLE;
+    return GST_RTSP_ERROR;
   }
 tunnel_closed:
   {
     g_mutex_unlock (tunnels_lock);
     GST_INFO ("client %p: tunnel session %s was closed", client, tunnelid);
     g_object_unref (oclient);
-    return GST_RTSP_STS_SERVICE_UNAVAILABLE;
+    return GST_RTSP_ERROR;
   }
 }