]> git.sesse.net Git - vlc/blobdiff - modules/access/rtsp/access.c
Remove extra braces.
[vlc] / modules / access / rtsp / access.c
index 94232b24d713d9f94f72a583f9534532892e2422..2a167d6e07495150a4b78164393b75f296904fe8 100644 (file)
@@ -16,9 +16,9 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -31,7 +31,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_access.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
 
 #include <vlc_network.h>
 #include "rtsp.h"
@@ -55,11 +55,10 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_INPUT_ACCESS )
     add_integer( "realrtsp-caching", 3000, NULL,
                  CACHING_TEXT, CACHING_LONGTEXT, true )
+        change_safe()
     set_capability( "access", 10 )
     set_callbacks( Open, Close )
-    add_shortcut( "realrtsp" )
-    add_shortcut( "rtsp" )
-    add_shortcut( "pnm" )
+    add_shortcut( "realrtsp", "rtsp", "pnm" )
 vlc_module_end ()
 
 
@@ -67,14 +66,11 @@ vlc_module_end ()
  * Exported prototypes
  *****************************************************************************/
 static block_t *BlockRead( access_t * );
-static int     Seek( access_t *, int64_t );
+static int     Seek( access_t *, uint64_t );
 static int     Control( access_t *, int, va_list );
 
 struct access_sys_t
 {
-    bool b_seekable;
-    bool b_pace_control;
-
     rtsp_client_t *p_rtsp;
 
     int fd;
@@ -95,7 +91,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, false, _("Connection failed"),
+        dialog_Fatal( p_access, _("Connection failed"),
                         _("VLC could not connect to \"%s:%d\"."), psz_server, i_port );
         return VLC_EGENERIC;
     }
@@ -125,7 +121,7 @@ static int RtspReadLine( void *p_userdata, uint8_t *p_buffer, int i_buffer )
     access_t *p_access = (access_t *)p_userdata;
     access_sys_t *p_sys = p_access->p_sys;
 
-    char *psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd, 0 );
+    char *psz = net_Gets( p_access, p_sys->fd, 0 );
 
     //fprintf(stderr, "ReadLine: %s\n", psz);
 
@@ -138,12 +134,13 @@ static int RtspReadLine( void *p_userdata, uint8_t *p_buffer, int i_buffer )
 
 static int RtspWrite( void *p_userdata, uint8_t *p_buffer, int i_buffer )
 {
+    VLC_UNUSED(i_buffer);
     access_t *p_access = (access_t *)p_userdata;
     access_sys_t *p_sys = p_access->p_sys;
 
     //fprintf(stderr, "Write: %s", p_buffer);
 
-    net_Printf( VLC_OBJECT(p_access), p_sys->fd, 0, "%s", p_buffer );
+    net_Printf( p_access, p_sys->fd, 0, "%s", p_buffer );
 
     return 0;
 }
@@ -194,10 +191,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_rtsp->pf_read_line = RtspReadLine;
     p_sys->p_rtsp->pf_write = RtspWrite;
 
-    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_path, 0 );
+    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_location, 0 );
     if( i_result )
     {
-        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_path );
+        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_location );
         free( p_sys->p_rtsp );
         p_sys->p_rtsp = NULL;
         goto error;
@@ -236,7 +233,7 @@ static int Open( vlc_object_t *p_this )
 
 
             msg_Err( p_access, "rtsp session can not be established" );
-            intf_UserFatal( p_access, false, _("Session failed"),
+            dialog_Fatal( p_access, _("Session failed"), "%s",
                     _("The requested RTSP session could not be established.") );
             goto error;
         }
@@ -308,8 +305,10 @@ static block_t *BlockRead( access_t *p_access )
 /*****************************************************************************
  * Seek: seek to a specific location in a file
  *****************************************************************************/
-static int Seek( access_t *p_access, int64_t i_pos )
+static int Seek( access_t *p_access, uint64_t i_pos )
 {
+    VLC_UNUSED(p_access);
+    VLC_UNUSED(i_pos);
     return VLC_SUCCESS;
 }
 
@@ -318,32 +317,22 @@ static int Seek( access_t *p_access, int64_t i_pos )
  *****************************************************************************/
 static int Control( access_t *p_access, int i_query, va_list args )
 {
-    bool   *pb_bool;
-    int          *pi_int;
-    int64_t      *pi_64;
-
     switch( i_query )
     {
         /* */
         case ACCESS_CAN_SEEK:
         case ACCESS_CAN_FASTSEEK:
-            pb_bool = (bool*)va_arg( args, bool* );
-            *pb_bool = false;//p_sys->b_seekable;
-            break;
-
         case ACCESS_CAN_PAUSE:
-            pb_bool = (bool*)va_arg( args, bool* );
-            *pb_bool = false;
+            *va_arg( args, bool* ) = false;
             break;
 
         case ACCESS_CAN_CONTROL_PACE:
-            pb_bool = (bool*)va_arg( args, bool* );
-            *pb_bool = true;//p_sys->b_pace_control;
+            *va_arg( args, bool* ) = true;
             break;
 
         case ACCESS_GET_PTS_DELAY:
-            pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = var_GetInteger( p_access, "realrtsp-caching" ) * 1000;
+            *va_arg( args, int64_t * ) =
+                    var_GetInteger(p_access,"realrtsp-caching")*1000;
             break;
 
         /* */