diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx index 4b512329f..d8a44ea5e 100644 --- a/src/decoder/plugins/FlacDecoderPlugin.cxx +++ b/src/decoder/plugins/FlacDecoderPlugin.cxx @@ -120,12 +120,6 @@ static FlacStreamDecoder flac_decoder_new(void) { FlacStreamDecoder sd; - if (!sd) { - LogError(flac_domain, - "FLAC__stream_decoder_new() failed"); - return sd; - } - if(!FLAC__stream_decoder_set_metadata_respond(sd.get(), FLAC__METADATA_TYPE_VORBIS_COMMENT)) LogDebug(flac_domain, "FLAC__stream_decoder_set_metadata_respond() has failed"); diff --git a/src/decoder/plugins/FlacStreamDecoder.hxx b/src/decoder/plugins/FlacStreamDecoder.hxx index 2ef7c3ded..18b18d159 100644 --- a/src/decoder/plugins/FlacStreamDecoder.hxx +++ b/src/decoder/plugins/FlacStreamDecoder.hxx @@ -25,6 +25,7 @@ #include #include +#include #include @@ -36,7 +37,10 @@ class FlacStreamDecoder { public: FlacStreamDecoder() - :decoder(FLAC__stream_decoder_new()) {} + :decoder(FLAC__stream_decoder_new()) { + if (decoder == nullptr) + throw std::runtime_error("FLAC__stream_decoder_new() failed"); + } FlacStreamDecoder(FlacStreamDecoder &&src) :decoder(src.decoder) {