[vlc-commits] Qt: MLItem: missing locks

Francois Cartegnie git at videolan.org
Tue Sep 4 16:11:36 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep  4 15:38:42 2012 +0200| [0bb6445c3fc4f99caa170855f5a226844a120e07] | committer: Francois Cartegnie

Qt: MLItem: missing locks

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

 modules/gui/qt4/components/playlist/ml_item.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/ml_item.cpp b/modules/gui/qt4/components/playlist/ml_item.cpp
index 92d17e0..82c7790 100644
--- a/modules/gui/qt4/components/playlist/ml_item.cpp
+++ b/modules/gui/qt4/components/playlist/ml_item.cpp
@@ -178,12 +178,17 @@ QVariant MLItem::data( int column ) const
         case ML_SCORE: return media->i_score ? media->i_score : QVariant();
         case ML_TITLE:
         {
+            vlc_mutex_lock( &media->lock );
+            qsz_return = qfu( media->psz_title );
+            vlc_mutex_unlock( &media->lock );
             /* If no title, return filename */
-            if( !EMPTY_STR( media->psz_title ) )
-                return qfu( media->psz_title );
+            if( ! qsz_return.isEmpty() )
+                return qsz_return;
             else
             {
+                vlc_mutex_lock( &media->lock );
                 QFileInfo p_file = QFileInfo( qfu( media->psz_uri ) );
+                vlc_mutex_unlock( &media->lock );
                 return p_file.fileName().isEmpty() ? p_file.absoluteFilePath()
                     : p_file.fileName();
             }



More information about the vlc-commits mailing list