[vlc-commits] Qt: save time on item destruction

Jean-Baptiste Kempf git at videolan.org
Mon May 19 12:52:19 CEST 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon May 19 11:53:42 2014 +0200| [40bcff3b764804bada4060e390a1367a0e08e930] | committer: Jean-Baptiste Kempf

Qt: save time on item destruction

Ref #5315

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

 modules/gui/qt4/input_manager.cpp |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 0126687..c8067ef 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -31,6 +31,7 @@
 #endif
 
 #include "input_manager.hpp"
+#include "recents.hpp"
 #include <vlc_keys.h>
 #include <vlc_url.h>
 #include <vlc_strings.h>
@@ -134,6 +135,15 @@ void InputManager::delInput()
     if( !p_input ) return;
     msg_Dbg( p_intf, "IM: Deleting the input" );
 
+    /* Save time / position */
+    float f_pos = var_GetFloat( p_input , "position" );
+    int64_t i_time = var_GetTime( p_input, "time");
+    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;
+    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {
+        i_time = -1;
+    }
+    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );
+
     delCallbacks();
     i_old_playing_status = END_S;
     p_item               = NULL;



More information about the vlc-commits mailing list