Commit 1c818ef0 authored by Max Kellermann's avatar Max Kellermann

decoder/flac: improve warning message about unsupported bit depth

parent d6ce2e36
......@@ -25,6 +25,7 @@
#include "FlacCommon.hxx"
#include "FlacMetadata.hxx"
#include "FlacPcm.hxx"
#include "FlacDomain.hxx"
#include "CheckAudioFormat.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
......@@ -57,10 +58,18 @@ FlacDecoder::Initialize(unsigned sample_rate, unsigned bits_per_sample,
assert(!initialized);
assert(!unsupported);
auto sample_format = flac_sample_format(bits_per_sample);
if (sample_format == SampleFormat::UNDEFINED) {
FormatWarning(flac_domain, "Unsupported FLAC bit depth: %u",
bits_per_sample);
unsupported = true;
return false;
}
::Error error;
if (!audio_format_init_checked(audio_format,
sample_rate,
flac_sample_format(bits_per_sample),
sample_format,
channels, error)) {
LogError(error);
unsupported = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment