]> git.sesse.net Git - vlc/blobdiff - modules/control/rc.c
Use input_GetVout
[vlc] / modules / control / rc.c
index 7df6606d4084c8b58905f4d196756dcfc0a628cd..8a85af2c01ed4319e20356c8a2825bb7032607bb 100644 (file)
@@ -34,7 +34,6 @@
 #include <vlc_plugin.h>
 
 #include <errno.h>                                                 /* ENOMEM */
-#include <ctype.h>
 #include <signal.h>
 #include <assert.h>
 
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>
 #endif
-
-#ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#endif
 #include <sys/types.h>
 
 #include <vlc_network.h>
@@ -220,14 +215,14 @@ static int Activate( vlc_object_t *p_this )
 #ifndef WIN32
 #if defined(HAVE_ISATTY)
     /* Check that stdin is a TTY */
-    if( !config_GetInt( p_intf, "rc-fake-tty" ) && !isatty( 0 ) )
+    if( !var_InheritInteger( p_intf, "rc-fake-tty" ) && !isatty( 0 ) )
     {
         msg_Warn( p_intf, "fd 0 is not a TTY" );
         return VLC_EGENERIC;
     }
 #endif
 
-    psz_unix_path = config_GetPsz( p_intf, "rc-unix" );
+    psz_unix_path = var_InheritString( p_intf, "rc-unix" );
     if( psz_unix_path )
     {
         int i_socket;
@@ -295,7 +290,7 @@ static int Activate( vlc_object_t *p_this )
 #endif /* !WIN32 */
 
     if( ( pi_socket == NULL ) &&
-        ( psz_host = config_GetPsz( p_intf, "rc-host" ) ) != NULL )
+        ( psz_host = var_InheritString( p_intf, "rc-host" ) ) != NULL )
     {
         vlc_url_t url;
 
@@ -334,7 +329,7 @@ static int Activate( vlc_object_t *p_this )
     p_intf->pf_run = Run;
 
 #ifdef WIN32
-    p_intf->p_sys->b_quiet = config_GetInt( p_intf, "rc-quiet" );
+    p_intf->p_sys->b_quiet = var_InheritInteger( p_intf, "rc-quiet" );
     if( !p_intf->p_sys->b_quiet ) { CONSOLE_INTRO_MSG; }
 #else
     CONSOLE_INTRO_MSG;
@@ -444,10 +439,10 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
 static void Run( intf_thread_t *p_intf )
 {
     input_thread_t * p_input = NULL;
-    playlist_t *     p_playlist = pl_Hold( p_intf );
+    playlist_t *     p_playlist = pl_Get( p_intf );
 
     char p_buffer[ MAX_LINE_LENGTH + 1 ];
-    bool b_showpos = config_GetInt( p_intf, "rc-show-pos" );
+    bool b_showpos = var_InheritInteger( p_intf, "rc-show-pos" );
     bool b_longhelp = false;
 
     int  i_size = 0;
@@ -748,9 +743,7 @@ static void Run( intf_thread_t *p_intf )
         case 'F':
             if( p_input )
             {
-                vout_thread_t *p_vout;
-                p_vout = input_GetVout( p_input );
-
+                vout_thread_t *p_vout = input_GetVout( p_input );
                 if( p_vout )
                 {
                     vlc_value_t val;
@@ -805,8 +798,6 @@ static void Run( intf_thread_t *p_intf )
         vlc_object_release( p_input );
     }
 
-    pl_Release( p_intf );
-
     var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
     vlc_restorecancel( canc );
 }