diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index dc126fc530..a3dc0d6bae 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -1743,6 +1743,15 @@ void ScreenSelectMusic::SwitchToPreferredDifficulty() } } +static bool IsVideoFile(const RString& path) { + const RString extension = GetExtension(path); + return extension == "mp4" || + extension == "avi" || + extension == "mov" || + extension == "mkv" || + extension == "mpg"; +} + void ScreenSelectMusic::AfterMusicChange() { if( !m_MusicWheel.IsRouletting() ) @@ -2004,14 +2013,23 @@ void ScreenSelectMusic::AfterMusicChange() if( bWantBanner ) { LOG->Trace("LoadFromCachedBanner(%s)",g_sBannerPath .c_str()); - if( m_Banner.LoadFromCachedBanner( g_sBannerPath ) ) + if( IsVideoFile(g_sBannerPath) ) { - /* If the high-res banner is already loaded, just delay before - * loading it, so the low-res one has time to fade in. */ - if( !TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) ) - m_BackgroundLoader.CacheFile( g_sBannerPath ); + // Directly load the video file. + m_Banner.LoadFromCachedBanner(g_sBannerPath); + g_bBannerWaiting = false; + } + else + { + if( m_Banner.LoadFromCachedBanner( g_sBannerPath ) ) + { + /* If the high-res banner is already loaded, just delay before + * loading it, so the low-res one has time to fade in. */ + if( !TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) ) + m_BackgroundLoader.CacheFile( g_sBannerPath ); - g_bBannerWaiting = true; + g_bBannerWaiting = true; + } } }