]> git.sesse.net Git - vlc/blobdiff - modules/access/rtsp/rtsp.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / access / rtsp / rtsp.c
index 02b80e907d30c14d0a9a0b3524aae2063595ec03..67fbf409b7ce4d70df9922c86ee31808cfed6d8a 100644 (file)
@@ -23,8 +23,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
 
 #include <vlc/vlc.h>
 
@@ -89,7 +87,7 @@ static char *rtsp_get( rtsp_client_t *rtsp )
   char *psz_buffer = malloc( BUF_SIZE );
   char *psz_string = NULL;
 
-  if( rtsp->pf_read_line( rtsp->p_userdata, psz_buffer, (unsigned int)BUF_SIZE ) >= 0 )
+  if( rtsp->pf_read_line( rtsp->p_userdata, (uint8_t*)psz_buffer, (unsigned int)BUF_SIZE ) >= 0 )
   {
     //printf( "<< '%s'\n", psz_buffer );
       psz_string = strdup( psz_buffer );
@@ -114,7 +112,7 @@ static int rtsp_put( rtsp_client_t *rtsp, const char *psz_string )
     psz_buffer[i_buffer] = '\r'; psz_buffer[i_buffer+1] = '\n';
     psz_buffer[i_buffer+2] = 0;
 
-    i_ret = rtsp->pf_write( rtsp->p_userdata, psz_buffer, i_buffer + 2 );
+    i_ret = rtsp->pf_write( rtsp->p_userdata, (uint8_t*)psz_buffer, i_buffer + 2 );
 
     free( psz_buffer );
     return i_ret;
@@ -142,7 +140,7 @@ static int rtsp_get_status_code( rtsp_client_t *rtsp, const char *psz_string )
 
     if( i_code != 200 )
     {
-        fprintf( stderr, "librtsp: server responds: '%s'\n", psz_string );
+        //fprintf( stderr, "librtsp: server responds: '%s'\n", psz_string );
     }
 
     return i_code;
@@ -249,15 +247,15 @@ static int rtsp_get_answers( rtsp_client_t *rtsp )
           {
               if( strcmp( buf, rtsp->p_private->session ) )
               {
-                  fprintf( stderr, 
-                           "rtsp: warning: setting NEW session: %s\n", buf );
+                  //fprintf( stderr,
+                  //         "rtsp: warning: setting NEW session: %s\n", buf );
                   free( rtsp->p_private->session );
                   rtsp->p_private->session = strdup( buf );
               }
           }
           else
           {
-              fprintf( stderr, "setting session id to: %s\n", buf );
+              //fprintf( stderr, "setting session id to: %s\n", buf );
               rtsp->p_private->session = strdup( buf );
           }
           free( buf );
@@ -393,13 +391,13 @@ int rtsp_request_tearoff( rtsp_client_t *rtsp, const char *what )
  * read opaque data from stream
  */
 
-int rtsp_read_data( rtsp_client_t *rtsp, char *buffer, unsigned int size )
+int rtsp_read_data( rtsp_client_t *rtsp, uint8_t *buffer, unsigned int size )
 {
     int i, seq;
 
     if( size >= 4 )
     {
-        i = rtsp->pf_read( rtsp->p_userdata, buffer, (unsigned int) 4 );
+        i = rtsp->pf_read( rtsp->p_userdata, (uint8_t*)buffer, (unsigned int) 4 );
         if( i < 4 ) return i;
 
         if( buffer[0]=='S' && buffer[1]=='E' && buffer[2]=='T' &&
@@ -422,7 +420,7 @@ int rtsp_read_data( rtsp_client_t *rtsp, char *buffer, unsigned int size )
 
             if( seq < 0 )
             {
-                fprintf(stderr, "warning: cseq not recognized!\n");
+                //fprintf(stderr, "warning: cseq not recognized!\n");
                 seq = 1;
             }
 
@@ -493,7 +491,7 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl,
     colon = strchr( mrl_ptr, ':' );
 
     if( !slash ) slash = mrl_ptr + strlen(mrl_ptr) + 1;
-    if( !colon ) colon = slash; 
+    if( !colon ) colon = slash;
     if( colon > slash ) colon = slash;
 
     pathbegin = slash - mrl_ptr;
@@ -515,13 +513,13 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl,
     }
 
     free( mrl_ptr );
-    fprintf( stderr, "got mrl: %s %i %s\n", s->host, s->port, s->path );
+    //fprintf( stderr, "got mrl: %s %i %s\n", s->host, s->port, s->path );
 
     s->s = rtsp->pf_connect( rtsp->p_userdata, s->host, s->port );
 
     if( s->s < 0 )
     {
-        fprintf(stderr, "rtsp: failed to connect to '%s'\n", s->host);
+        //fprintf(stderr, "rtsp: failed to connect to '%s'\n", s->host);
         rtsp_close( rtsp );
         return -1;
     }
@@ -546,7 +544,7 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl,
 }
 
 /*
- * closes an rtsp connection 
+ * closes an rtsp connection
  */
 
 void rtsp_close( rtsp_client_t *rtsp )
@@ -632,7 +630,7 @@ void rtsp_schedule_field( rtsp_client_t *rtsp, const char *string )
 }
 
 /*
- * removes the first scheduled field which prefix matches string. 
+ * removes the first scheduled field which prefix matches string.
  */
 
 void rtsp_unschedule_field( rtsp_client_t *rtsp, const char *string )