]> git.sesse.net Git - vlc/blobdiff - modules/access/ftp.c
Simplify and fix the block flag test in dirac packetizer.
[vlc] / modules / access / ftp.c
index 6aac40f0c8b21c2fdfaa2b4679a4b36d25453c46..c6ac6df16325a3fd8449651f204219d8dcb63193 100644 (file)
@@ -36,7 +36,7 @@
 #include <assert.h>
 
 #include <vlc_access.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
 
 #include <vlc_network.h>
 #include <vlc_url.h>
@@ -76,6 +76,7 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_INPUT_ACCESS )
     add_integer( "ftp-caching", 2 * DEFAULT_PTS_DELAY / 1000, NULL,
                  CACHING_TEXT, CACHING_LONGTEXT, true )
+        change_safe()
     add_string( "ftp-user", "anonymous", NULL, USER_TEXT, USER_LONGTEXT,
                 false )
     add_string( "ftp-pwd", "anonymous@example.com", NULL, PASS_TEXT,
@@ -91,6 +92,7 @@ vlc_module_begin ()
         set_capability( "sout access", 0 )
         set_category( CAT_SOUT )
         set_subcategory( SUBCAT_SOUT_ACO )
+        add_shortcut( "ftp" )
         set_callbacks( OutOpen, OutClose )
 vlc_module_end ()
 
@@ -133,7 +135,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
     if( fd == -1 )
     {
         msg_Err( p_access, "connection failed" );
-        intf_UserFatal( p_access, false, _("Network interaction failed"),
+        dialog_Fatal( p_access, _("Network interaction failed"), "%s",
                         _("VLC could not connect with the given server.") );
         return -1;
     }
@@ -143,7 +145,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
     if( i_answer / 100 != 2 )
     {
         msg_Err( p_access, "connection rejected" );
-        intf_UserFatal( p_access, false, _("Network interaction failed"),
+        dialog_Fatal( p_access, _("Network interaction failed"), "%s",
                         _("VLC's connection to the given server was rejected.") );
         return -1;
     }
@@ -207,9 +209,9 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
                     if( i_answer / 100 != 2 )
                     {
                         msg_Err( p_access, "account rejected" );
-                        intf_UserFatal( p_access, false,
-                                        _("Network interaction failed"),
-                                        _("Your account was rejected.") );
+                        dialog_Fatal( p_access,
+                                      _("Network interaction failed"),
+                                      "%s", _("Your account was rejected.") );
                         return -1;
                     }
                     msg_Dbg( p_access, "account accepted" );
@@ -217,16 +219,14 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
 
                 default:
                     msg_Err( p_access, "password rejected" );
-                    intf_UserFatal( p_access, false,
-                                    _("Network interaction failed"),
-                                    _("Your password was rejected.") );
+                    dialog_Fatal( p_access, _("Network interaction failed"),
+                                  "%s",  _("Your password was rejected.") );
                     return -1;
             }
             break;
         default:
             msg_Err( p_access, "user rejected" );
-            intf_UserFatal( p_access, false,
-                        _("Network interaction failed"),
+            dialog_Fatal( p_access, _("Network interaction failed"), "%s",
                         _("Your connection attempt to the server was rejected.") );
             return -1;
     }
@@ -508,7 +508,6 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
                       p_sys->url.psz_host, p_sys->url.i_port,
                       p_sys->url.psz_path, psz_line );
             free( psz_line );
-            msg_Err( p_access, "%s", p_buffer );
             return strlen( (const char *)p_buffer );
         }
     }
@@ -554,9 +553,8 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
  *****************************************************************************/
 static int Control( access_t *p_access, int i_query, va_list args )
 {
-    bool   *pb_bool;
-    int          *pi_int;
-    int64_t      *pi_64;
+    bool    *pb_bool;
+    int64_t *pi_64;
 
     switch( i_query )
     {
@@ -579,11 +577,6 @@ static int Control( access_t *p_access, int i_query, va_list args )
             break;
 
         /* */
-        case ACCESS_GET_MTU:
-            pi_int = (int*)va_arg( args, int * );
-            *pi_int = 0;
-            break;
-
         case ACCESS_GET_PTS_DELAY:
             pi_64 = (int64_t*)va_arg( args, int64_t * );
             *pi_64 = (int64_t)var_GetInteger( p_access, "ftp-caching" ) * INT64_C(1000);