Skip to content

Commit

Permalink
Print Miniaudio error when wav decode fails to initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Feb 4, 2025
1 parent e8ca28f commit 53f1e86
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/SFML/Audio/SoundFileReaderWav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ bool SoundFileReaderWav::check(InputStream& stream)
config.format = ma_format_s16;
ma_decoder decoder{};

if (ma_decoder_init(&onRead, &onSeek, &stream, &config, &decoder) == MA_SUCCESS)
if (const auto result = ma_decoder_init(&onRead, &onSeek, &stream, &config, &decoder); result != MA_SUCCESS)
{
ma_decoder_uninit(&decoder);
return true;
err() << "Failed to initialize wav decoder: " << ma_result_description(result) << std::endl;
return false;
}

return false;
ma_decoder_uninit(&decoder);
return true;
}


Expand Down

0 comments on commit 53f1e86

Please sign in to comment.