Commit 0bb6445c authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: MLItem: missing locks

parent a3d24181
...@@ -178,12 +178,17 @@ QVariant MLItem::data( int column ) const ...@@ -178,12 +178,17 @@ QVariant MLItem::data( int column ) const
case ML_SCORE: return media->i_score ? media->i_score : QVariant(); case ML_SCORE: return media->i_score ? media->i_score : QVariant();
case ML_TITLE: 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 no title, return filename */
if( !EMPTY_STR( media->psz_title ) ) if( ! qsz_return.isEmpty() )
return qfu( media->psz_title ); return qsz_return;
else else
{ {
vlc_mutex_lock( &media->lock );
QFileInfo p_file = QFileInfo( qfu( media->psz_uri ) ); QFileInfo p_file = QFileInfo( qfu( media->psz_uri ) );
vlc_mutex_unlock( &media->lock );
return p_file.fileName().isEmpty() ? p_file.absoluteFilePath() return p_file.fileName().isEmpty() ? p_file.absoluteFilePath()
: p_file.fileName(); : p_file.fileName();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment