Use "can-rate" and "state" input variable when applicable.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 16 Jan 2009 20:19:27 +0000 (21:19 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 11:35:48 +0000 (12:35 +0100)
 It seems that both gui/pda/pda.c and gui/macosx/intf.m fetch "can-rate" value
but does not use it, could maintainers check it ...

 The inhibit and screensaver modules are using bad object_find. Proper
playlist event handling would be cleaner.

modules/gui/macosx/controls.m
modules/gui/macosx/intf.m
modules/gui/pda/pda.c
modules/misc/inhibit.c
modules/misc/screensaver.c

index dfe7bc7..0d50a5b 100644 (file)
     {
         if( p_input != NULL )
         {
-            bEnabled = p_input->b_can_pace_control;
+            bEnabled = var_GetBool( p_input, "can-rate" );
         }
         else
         {
index 4d2691a..f0191e3 100644 (file)
@@ -1525,7 +1525,7 @@ static void * manage_cleanup( void * args )
             b_seekable = var_GetBool( p_input, "can-seek" );
 
             /* check whether slow/fast motion is possible */
-            b_control = p_input->b_can_pace_control;
+            b_control = var_GetBool( p_input, "can-rate" );
 
             /* chapters & titles */
             //b_chapters = p_input->stream.i_area_nb > 1;
index e26f802..109cb18 100644 (file)
@@ -596,7 +596,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
         }
 
         /* control buttons for free pace streams */
-        b_control = p_intf->p_sys->p_input->b_can_pace_control;
+        b_control = var_GetBool( p_intf->p_sys->p_input, "can-rate" );
 
         msg_Dbg( p_intf, "stream has changed, refreshing interface" );
     }
index 2fe1dd6..e9aeba2 100644 (file)
@@ -229,7 +229,7 @@ static void Run( intf_thread_t *p_intf )
         p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
         if( p_input )
         {
-            int i_state = p_input->i_state;
+            const int i_state = var_GetInteger( p_input, "state" );
             vlc_object_release( p_input );
 
             if( PLAYING_S == i_state && !p_intf->p_sys->i_cookie )
index 62525b9..f7b56ea 100644 (file)
@@ -185,7 +185,7 @@ static void Run( intf_thread_t *p_intf )
             vlc_object_release( p_vout );
             if( p_input )
             {
-                if( PLAYING_S == p_input->i_state )
+                if( PLAYING_S == var_GetInteger( p_input, "state" ) )
                 {
                     /* http://www.jwz.org/xscreensaver/faq.html#dvd */
                     const char *const ppsz_xsargs[] = { "/bin/sh", "-c",