]> git.sesse.net Git - vlc/blobdiff - modules/control/hotkeys.c
Use KiB instead of kB for input statistics
[vlc] / modules / control / hotkeys.c
index bb989bf0978b69fb558085f8e2b46b5740a07475..0d77fab74a68a4c0b5e168cf9aa848c322562c71 100644 (file)
@@ -146,7 +146,7 @@ static void Close( vlc_object_t *p_this )
 static int PutAction( intf_thread_t *p_intf, int i_action )
 {
     intf_sys_t *p_sys = p_intf->p_sys;
-    playlist_t *p_playlist = pl_Hold( p_intf );
+    playlist_t *p_playlist = pl_Get( p_intf );
 
     /* Update the input */
     input_thread_t *p_input = playlist_CurrentInput( p_playlist );
@@ -229,15 +229,16 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
 
         case ACTIONID_TOGGLE_FULLSCREEN:
         {
-            vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
-                                       : VLC_OBJECT(p_playlist);
-            var_ToggleBool( obj, "fullscreen" );
+            bool fs = var_ToggleBool( p_playlist, "fullscreen" );
+            if( p_vout )
+                var_SetBool( p_vout, "fullscreen", fs );
             break;
         }
 
         case ACTIONID_LEAVE_FULLSCREEN:
-            if( p_vout && var_GetBool( p_vout, "fullscreen" ) )
+            if( p_vout )
                 var_SetBool( p_vout, "fullscreen", false );
+            var_SetBool( p_playlist, "fullscreen", false );
             break;
 
         case ACTIONID_ZOOM_QUARTER:
@@ -653,7 +654,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
                                   val_list.p_list->p_values[i].f_float );
                     vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
                                      _("Zoom mode: %s"),
-                                text_list.p_list->p_values[i].var.psz_name );
+                                text_list.p_list->p_values[i].psz_string );
 
                     var_FreeList( &val_list, &text_list );
                 }
@@ -869,13 +870,12 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
             {
                 if( var_GetBool( p_input, "can-record" ) )
                 {
-                    const bool b_record = !var_GetBool( p_input, "record" );
+                    const bool b_record = var_ToggleBool( p_input, "record" );
 
                     if( b_record )
                         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _("Recording") );
                     else
                         vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _("Recording done") );
-                    var_SetBool( p_input, "record", b_record );
                 }
             }
         }
@@ -887,7 +887,6 @@ cleanup_and_continue:
         vlc_object_release( p_vout );
     if( p_input )
         vlc_object_release( p_input );
-    pl_Release( p_intf );
     return VLC_SUCCESS;
 }
 
@@ -960,7 +959,7 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
     if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
         return;
 
-    playlist_t *p_playlist = pl_Hold( p_intf );
+    playlist_t *p_playlist = pl_Get( p_intf );
     char *psz_bookmark = var_CreateGetString( p_intf, psz_bookmark_name );
 
     PL_LOCK;
@@ -980,7 +979,6 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
 
     free( psz_bookmark );
     free( psz_bookmark_name );
-    pl_Release( p_intf );
 }
 
 static void SetBookmark( intf_thread_t *p_intf, int i_num )
@@ -989,7 +987,7 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
     if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
         return;
 
-    playlist_t *p_playlist = pl_Hold( p_intf );
+    playlist_t *p_playlist = pl_Get( p_intf );
     var_Create( p_intf, psz_bookmark_name,
                 VLC_VAR_STRING|VLC_VAR_DOINHERIT );
     playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
@@ -1002,7 +1000,6 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
         config_SaveConfigFile( p_intf, "hotkeys" );
     }
 
-    pl_Release( p_intf );
     free( psz_bookmark_name );
 }