Log audio decoding errors

Originally committed to SVN as r6961.
This commit is contained in:
Thomas Goyne 2012-08-18 15:22:07 +00:00
parent 79684d5ad6
commit 18db0b09ac

View file

@ -64,9 +64,15 @@ void AudioProvider::GetAudioWithVolume(void *buf, int64_t start, int64_t count,
try {
GetAudio(buf,start,count);
}
catch (AudioDecodeError const& e) {
LOG_E("audio_provider") << e.GetChainedMessage();
memset(buf, 0, count*bytes_per_sample);
return;
}
catch (...) {
// FIXME: Poor error handling though better than none, to patch issue #800.
// Just return blank audio if real provider fails.
LOG_E("audio_provider") << "Unknown audio decoding error";
memset(buf, 0, count*bytes_per_sample);
return;
}