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

Hugo Beauzée-Luyssen git at videolan.org
Tue Dec 8 19:13:58 CET 2015


vlc/vlc-2.2 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Dec  8 15:26:38 2015 +0100| [1317319c41747c9be6e0fabf450b2831e97cee19] | committer: Jean-Baptiste Kempf

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

fixes #14399

(cherry picked from commit a26999c1f42ea4173d4e3ea64bfc554b36becc30)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 16c89fe..22b9698 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -142,10 +142,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