1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-19 19:10:20 +02:00

Merge pull request #4801 from Laserlicht/fix_mp3

fix for defect mp3
This commit is contained in:
Ivan Savenko 2024-10-23 22:21:23 +03:00 committed by GitHub
commit 9ba7e227ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,7 +265,12 @@ void MusicEntry::load(const AudioPath & musicURI)
try
{
auto * musicFile = MakeSDLRWops(CResourceHandler::get()->load(currentName));
std::unique_ptr<CInputStream> stream = CResourceHandler::get()->load(currentName);
if(musicURI.getName() == "BLADEFWCAMPAIGN") // handle defect MP3 file - ffprobe says: Skipping 52 bytes of junk at 0.
stream->seek(52);
auto * musicFile = MakeSDLRWops(std::move(stream));
music = Mix_LoadMUS_RW(musicFile, SDL_TRUE);
}
catch(std::exception & e)