Commit 2d97d88f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Metadata: Common: Remove useless scope

parent ffa5e52c
......@@ -72,33 +72,31 @@ bool medialibrary::MetadataCommon::startPlayback( VLC::Media& media, VLC::MediaP
});
}
{
std::unique_lock<compat::Mutex> lock( mutex );
mp.play();
success = cond.wait_for( lock, std::chrono::seconds( 3 ), [&failedToStart, &hasAnyTrack]() {
return failedToStart == true || hasAnyTrack == true;
});
std::unique_lock<compat::Mutex> lock( mutex );
mp.play();
success = cond.wait_for( lock, std::chrono::seconds( 3 ), [&failedToStart, &hasAnyTrack]() {
return failedToStart == true || hasAnyTrack == true;
});
// In case the playback failed, we probably won't fetch anything interesting anyway.
if ( failedToStart == true || success == false )
return false;
// In case the playback failed, we probably won't fetch anything interesting anyway.
if ( failedToStart == true || success == false )
return false;
// If we have any kind of track, but not a video track, we don't have to wait long, tracks are usually
// being discovered together.
if ( hasVideoTrack == false )
// If we have any kind of track, but not a video track, we don't have to wait long, tracks are usually
// being discovered together.
if ( hasVideoTrack == false )
{
if ( watchForArtworkChange == true )
{
cond.wait_for( lock, std::chrono::milliseconds( 500 ), [&metaArtworkChanged]() {
return metaArtworkChanged == true;
});
}
else
{
if ( watchForArtworkChange == true )
{
cond.wait_for( lock, std::chrono::milliseconds( 500 ), [&metaArtworkChanged]() {
return metaArtworkChanged == true;
});
}
else
{
cond.wait_for( lock, std::chrono::seconds( 1 ), [&hasVideoTrack]() {
return hasVideoTrack == true;
});
}
cond.wait_for( lock, std::chrono::seconds( 1 ), [&hasVideoTrack]() {
return hasVideoTrack == true;
});
}
}
......
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