[vlc-commits] Qt: MLItem: add missing lock and fix scheme fixing
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:02:10 2012 +0200| [847690d238dd9d957d24352fdde69703dc3bc64a] | committer: Francois Cartegnie
Qt: MLItem: add missing lock and fix scheme fixing
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=847690d238dd9d957d24352fdde69703dc3bc64a
---
modules/gui/qt4/components/playlist/ml_item.cpp | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/ml_item.cpp b/modules/gui/qt4/components/playlist/ml_item.cpp
index 18794bb..372993a 100644
--- a/modules/gui/qt4/components/playlist/ml_item.cpp
+++ b/modules/gui/qt4/components/playlist/ml_item.cpp
@@ -286,12 +286,15 @@ ml_media_t* MLItem::getMedia() const
QUrl MLItem::getUri() const
{
- if( !media->psz_uri ) return QUrl(); // This should be rootItem
- QString uri = qfu( media->psz_uri );
- if( uri.contains( "://" ) )
- return QUrl( uri );
- else
- return QUrl( "file://" + uri );
+ QString uri;
+ vlc_mutex_lock( &media->lock );
+ uri = QString( media->psz_uri );
+ vlc_mutex_unlock( &media->lock );
+ if ( uri.isEmpty() ) return QUrl(); // This should be rootItem
+
+ QUrl url( uri );
+ if ( url.scheme().isEmpty() ) url.setScheme( "file" );
+ return url;
}
bool MLItem::operator<( MLItem* item )
More information about the vlc-commits
mailing list