Commit 847690d2 authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: MLItem: add missing lock and fix scheme fixing

parent 1ebf4b12
...@@ -286,12 +286,15 @@ ml_media_t* MLItem::getMedia() const ...@@ -286,12 +286,15 @@ ml_media_t* MLItem::getMedia() const
QUrl MLItem::getUri() const QUrl MLItem::getUri() const
{ {
if( !media->psz_uri ) return QUrl(); // This should be rootItem QString uri;
QString uri = qfu( media->psz_uri ); vlc_mutex_lock( &media->lock );
if( uri.contains( "://" ) ) uri = QString( media->psz_uri );
return QUrl( uri ); vlc_mutex_unlock( &media->lock );
else if ( uri.isEmpty() ) return QUrl(); // This should be rootItem
return QUrl( "file://" + uri );
QUrl url( uri );
if ( url.scheme().isEmpty() ) url.setScheme( "file" );
return url;
} }
bool MLItem::operator<( MLItem* item ) bool MLItem::operator<( MLItem* item )
......
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