]> git.sesse.net Git - vlc/blobdiff - modules/access/rtsp/access.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / access / rtsp / access.c
index e917f1e9c90503a4cbae816259581b6ae253d7ea..af182cccc44cc04c425705ccb65087d76085fe12 100644 (file)
  * Preamble
  *****************************************************************************/
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc_interaction.h>
+#include <vlc_access.h>
+#include <vlc_interface.h>
 
-#include "network.h"
+#include <vlc_network.h>
 #include "rtsp.h"
 #include "real.h"
 
@@ -90,7 +90,7 @@ static int RtspConnect( void *p_userdata, char *psz_server, int i_port )
     if( p_sys->fd < 0 )
     {
         msg_Err( p_access, "cannot connect to %s:%d", psz_server, i_port );
-        intf_UserFatal( p_access, VLC_FALSE, _("Connection failed"), 
+        intf_UserFatal( p_access, VLC_FALSE, _("Connection failed"),
                         _("VLC could not connect to \"%s:%d\"."), psz_server, i_port );
         return VLC_EGENERIC;
     }
@@ -153,7 +153,13 @@ static int Open( vlc_object_t *p_this )
     char *psz_server = 0;
     int i_result;
 
-    if( !p_access->b_force ) return VLC_EGENERIC;
+    if( !p_access->psz_access || (
+        strncmp( p_access->psz_access, "rtsp", 4 ) &&
+        strncmp( p_access->psz_access, "pnm", 3 )  &&
+        strncmp( p_access->psz_access, "realrtsp", 8 ) ))
+    {
+            return VLC_EGENERIC;
+    }
 
     p_access->pf_read = NULL;
     p_access->pf_block = BlockRead;
@@ -218,19 +224,19 @@ static int Open( vlc_object_t *p_this )
 
 
             msg_Err( p_access, "rtsp session can not be established" );
-            intf_UserFatal( p_access, VLC_FALSE, _("Session failed"), 
+            intf_UserFatal( p_access, VLC_FALSE, _("Session failed"),
                     _("The requested RTSP session could not be established.") );
             goto error;
         }
 
         p_sys->p_header = block_New( p_access, 4096 );
         p_sys->p_header->i_buffer =
-            rmff_dump_header( h, p_sys->p_header->p_buffer, 1024 );
+            rmff_dump_header( h, (char *)p_sys->p_header->p_buffer, 1024 );
         rmff_free_header( h );
     }
     else
     {
-        msg_Dbg( p_access, "only real/helix rtsp servers supported for now" );
+        msg_Warn( p_access, "only real/helix rtsp servers supported for now" );
         goto error;
     }