[vlc-commits] qt4: the playlist should be locked when calling playlist_GetNodeDuration

Rémi Duraffort git at videolan.org
Sat Dec 22 11:50:31 CET 2012


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Dec 22 11:50:11 2012 +0100| [3629b93e6025b70bbcf513c3b55ee0e4952455a4] | committer: Rémi Duraffort

qt4: the playlist should be locked when calling playlist_GetNodeDuration

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

 modules/gui/qt4/components/playlist/selector.cpp |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 863fcc5..89747aa 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -199,9 +199,14 @@ void PLSelector::updateTotalDuration( PLSelItem* item, const char* prefix )
     QVariant playlistVariant = item->treeItem()->data( 0, PL_ITEM_ROLE );
     playlist_item_t* node = playlistVariant.value<playlist_item_t*>();
 
+    /* Get the duration of the playlist item */
+    playlist_Lock( THEPL );
+    mtime_t mt_duration = playlist_GetNodeDuration( node );
+    playlist_Unlock( THEPL );
+
     /* Formatting time */
     QString qs_timeLabel( prefix );
-    mtime_t mt_duration = playlist_GetNodeDuration( node );
+
     int i_seconds = mt_duration / 1000000;
     int i_minutes = i_seconds / 60;
     i_seconds = i_seconds % 60;



More information about the vlc-commits mailing list