[vlc-commits] qt4: Fix "resume where you left off"
Hugo Beauzée-Luyssen
git at videolan.org
Thu Feb 18 18:15:08 CET 2016
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Feb 16 17:20:03 2016 +0100| [60399fdf58f7ad61c6e561e0f81cb736cb5413b0] | committer: Hugo Beauzée-Luyssen
qt4: Fix "resume where you left off"
fix #16593
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60399fdf58f7ad61c6e561e0f81cb736cb5413b0
---
modules/gui/qt4/input_manager.cpp | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index cae2735..5bbbcd3 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -113,11 +113,11 @@ void InputManager::setInput( input_thread_t *_p_input )
p_item = input_GetItem( p_input );
emit rateChanged( var_GetFloat( p_input, "rate" ) );
- char *uri = input_item_GetURI( p_item );
-
/* Get Saved Time */
if( p_item->i_type == ITEM_TYPE_FILE )
{
+ char *uri = input_item_GetURI( p_item );
+
int i_time = RecentsMRL::getInstance( p_intf )->time( qfu(uri) );
if( i_time > 0 && qfu( uri ) != lastURI &&
!var_GetFloat( p_input, "run-time" ) &&
@@ -126,20 +126,19 @@ void InputManager::setInput( input_thread_t *_p_input )
{
emit resumePlayback( (int64_t)i_time * 1000 );
}
+ playlist_Lock( THEPL );
+ // Add root items only
+ playlist_item_t* p_node = playlist_CurrentPlayingItem( THEPL );
+ if ( p_node != NULL && ( p_node->p_parent == NULL || p_node->i_children == -1 ) )
+ {
+ // 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 );
}
-
- 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