decoder/{dsdiff,dsf,mpg123,wavpack}: avoid exceptions in scan methods

The scan methods must be "noexcept".
This commit is contained in:
Max Kellermann
2018-01-25 13:01:39 +01:00
parent 47fa8c4cf6
commit fd0a5a1116
4 changed files with 33 additions and 13 deletions

View File

@@ -334,14 +334,14 @@ dsf_scan_stream(InputStream &is,
if (!dsf_read_metadata(nullptr, is, &metadata))
return false;
auto audio_format = CheckAudioFormat(metadata.sample_rate / 8,
SampleFormat::DSD,
metadata.channels);
const auto sample_rate = metadata.sample_rate / 8;
if (!audio_valid_sample_rate(sample_rate))
return false;
/* calculate song time and add as tag */
const auto n_blocks = metadata.n_blocks;
auto songtime = SongTime::FromScale<uint64_t>(n_blocks * DSF_BLOCK_SIZE,
audio_format.sample_rate);
sample_rate);
tag_handler_invoke_duration(handler, handler_ctx, songtime);
#ifdef ENABLE_ID3TAG