[vlc-commits] qt4: input_manager: Only add root items to recent items list

Hugo Beauzée-Luyssen git at videolan.org
Tue Dec 8 15:44:24 CET 2015


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Dec  8 15:26:38 2015 +0100| [a26999c1f42ea4173d4e3ea64bfc554b36becc30] | committer: Hugo Beauzée-Luyssen

qt4: input_manager: Only add root items to recent items list

fixes #14399

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a26999c1f42ea4173d4e3ea64bfc554b36becc30
---

 modules/gui/qt4/input_manager.cpp |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index c23e4ae..0aac345 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -128,10 +128,17 @@ void InputManager::setInput( input_thread_t *_p_input )
             }
         }
 
-        // Save the latest URI to avoid asking to restore the
-        // position on the same input file.
-        lastURI = qfu( uri );
-        RecentsMRL::getInstance( p_intf )->addRecent( lastURI );
+        playlist_Lock( THEPL );
+        // Add root items only
+        playlist_item_t* p_node = playlist_CurrentPlayingItem( THEPL );
+        if ( p_node != NULL && p_node->p_parent == NULL )
+        {
+            // Save the latest URI to avoid asking to restore the
+            // position on the same input file.
+            lastURI = qfu( uri );
+            RecentsMRL::getInstance( p_intf )->addRecent( lastURI );
+        }
+        playlist_Unlock( THEPL );
         free( uri );
     }
     else



More information about the vlc-commits mailing list