From e2f10f5ba586c5c4d1bdf400b3bab55d3a7f742c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 13 Apr 2012 15:27:22 +0200 Subject: [PATCH] rtsp-server: Fix compilation and compiler warnings --- gst/rtsp-server/rtsp-auth.c | 4 ++-- gst/rtsp-server/rtsp-auth.h | 2 +- gst/rtsp-server/rtsp-client.c | 14 ++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/gst/rtsp-server/rtsp-auth.c b/gst/rtsp-server/rtsp-auth.c index e01315ccdb..11656776b6 100644 --- a/gst/rtsp-server/rtsp-auth.c +++ b/gst/rtsp-server/rtsp-auth.c @@ -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 diff --git a/gst/rtsp-server/rtsp-auth.h b/gst/rtsp-server/rtsp-auth.h index 3aadeffd67..5f06acbde7 100644 --- a/gst/rtsp-server/rtsp-auth.h +++ b/gst/rtsp-server/rtsp-auth.h @@ -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); diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index f814c5164a..8c08fd1c27 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -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; } }