]> git.sesse.net Git - vlc/blobdiff - modules/access/rtsp/rtsp.c
avio: remove interrupt callback for output
[vlc] / modules / access / rtsp / rtsp.c
index 67b5b6eb8a97197d0a4d41c7b5a86965b32ce371..7b1e606df0d1d9363bd9757e616027f269d7c2fe 100644 (file)
@@ -28,7 +28,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 
 #include "rtsp.h"
 
@@ -128,6 +128,7 @@ static int rtsp_put( rtsp_client_t *rtsp, const char *psz_string )
 
 static int rtsp_get_status_code( rtsp_client_t *rtsp, const char *psz_string )
 {
+    VLC_UNUSED(rtsp);
     char psz_buffer[4];
     int i_code = 0;
 
@@ -137,7 +138,7 @@ static int rtsp_get_status_code( rtsp_client_t *rtsp, const char *psz_string )
         psz_buffer[3] = 0;
         i_code = atoi( psz_buffer );
     }
-    else if( !strncmp( psz_string, "SET_PARAMETER", 8 ) )
+    else if( !strncmp( psz_string, "SET_PARAMETER", sizeof("SET_PARAMETER") - 1 ) )
     {
         return RTSP_STATUS_SET_PARAMETER;
     }
@@ -240,7 +241,7 @@ static int rtsp_get_answers( rtsp_client_t *rtsp )
       {
           char *buf = malloc( strlen(answer) );
           sscanf( answer, "%*s %s", buf );
-          if( rtsp->p_private->server ) free( rtsp->p_private->server );
+          free( rtsp->p_private->server );
           rtsp->p_private->server = buf;
       }
       if( !strncasecmp( answer, "Session:", 8 ) )
@@ -559,12 +560,12 @@ void rtsp_close( rtsp_client_t *rtsp )
         rtsp->pf_disconnect( rtsp->p_userdata );
     }
 
-    if( rtsp->p_private->path ) free( rtsp->p_private->path );
-    if( rtsp->p_private->host ) free( rtsp->p_private->host );
-    if( rtsp->p_private->mrl ) free( rtsp->p_private->mrl );
-    if( rtsp->p_private->session ) free( rtsp->p_private->session );
-    if( rtsp->p_private->user_agent ) free( rtsp->p_private->user_agent );
-    if( rtsp->p_private->server ) free( rtsp->p_private->server );
+    free( rtsp->p_private->path );
+    free( rtsp->p_private->host );
+    free( rtsp->p_private->mrl );
+    free( rtsp->p_private->session );
+    free( rtsp->p_private->user_agent );
+    free( rtsp->p_private->server );
     rtsp_free_answers( rtsp );
     rtsp_unschedule_all( rtsp );
     free( rtsp->p_private );
@@ -604,7 +605,7 @@ char *rtsp_search_answers( rtsp_client_t *rtsp, const char *tag )
 
 void rtsp_set_session( rtsp_client_t *rtsp, const char *id )
 {
-    if( rtsp->p_private->session ) free( rtsp->p_private->session );
+    free( rtsp->p_private->session );
     rtsp->p_private->session = strdup(id);
 }
 
@@ -647,7 +648,7 @@ void rtsp_unschedule_field( rtsp_client_t *rtsp, const char *string )
     {
       if( !strncmp(*ptr, string, strlen(string)) ) break;
     }
-    if( *ptr ) free( *ptr );
+    free( *ptr );
     ptr++;
     do
     {