]> git.sesse.net Git - vlc/commitdiff
skins2: update current input if its associated item changes.
authorErwan Tulou <erwan10@videolan.org>
Mon, 28 Jan 2013 11:54:47 +0000 (12:54 +0100)
committerErwan Tulou <erwan10@videolan.org>
Mon, 28 Jan 2013 14:18:43 +0000 (15:18 +0100)
This is the right place to make sure an art file that was not available at
input launch time gets a chance to be displayed as soon as it becomes available.

modules/gui/skins2/commands/cmd_vars.cpp

index 423be4b77d2a9533de7ee32e4d0bb7d02f72eebd..dfde4f3cd3bda02eea8f5cecdcc9d142da859267 100644 (file)
@@ -33,6 +33,7 @@ void CmdItemUpdate::execute()
     if( !m_pItem )
         return;
 
+    // update playtree
     playlist_t* pPlaylist = getIntf()->p_sys->p_playlist;
     playlist_Lock( pPlaylist );
     playlist_item_t* p_plItem = playlist_ItemGetByInput( pPlaylist, m_pItem );
@@ -41,6 +42,15 @@ void CmdItemUpdate::execute()
 
     if( id )
         VlcProc::instance( getIntf() )->getPlaytreeVar().onUpdateItem( id );
+
+    // update current input if needed
+    input_item_t* p_current = NULL;
+    input_thread_t* pInput = getIntf()->p_sys->p_input;
+    if( pInput )
+        p_current = input_GetItem( pInput );
+
+    if( p_current == m_pItem )
+        VlcProc::instance( getIntf() )->update_current_input();
 }
 
 bool CmdItemUpdate::checkRemove( CmdGeneric *pQueuedCommand ) const