decoder/flac: use C++11 initializers

This commit is contained in:
Max Kellermann 2016-07-11 22:44:39 +02:00
parent 0246082b9b
commit 85b6a52662
2 changed files with 6 additions and 12 deletions

View File

@ -29,14 +29,6 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "Log.hxx" #include "Log.hxx"
FlacDecoder::FlacDecoder(Decoder &_decoder,
InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder),
initialized(false), unsupported(false),
position(0)
{
}
static SampleFormat static SampleFormat
flac_sample_format(unsigned bits_per_sample) flac_sample_format(unsigned bits_per_sample)
{ {

View File

@ -41,12 +41,12 @@ struct FlacDecoder : public FlacInput {
/** /**
* Has decoder_initialized() been called yet? * Has decoder_initialized() been called yet?
*/ */
bool initialized; bool initialized = false;
/** /**
* Does the FLAC file contain an unsupported audio format? * Does the FLAC file contain an unsupported audio format?
*/ */
bool unsupported; bool unsupported = false;
/** /**
* The validated audio format of the FLAC file. This * The validated audio format of the FLAC file. This
@ -58,11 +58,13 @@ struct FlacDecoder : public FlacInput {
* End of last frame's position within the stream. This is * End of last frame's position within the stream. This is
* used for bit rate calculations. * used for bit rate calculations.
*/ */
FLAC__uint64 position; FLAC__uint64 position = 0;
Tag tag; Tag tag;
FlacDecoder(Decoder &decoder, InputStream &input_stream);
FlacDecoder(Decoder &_decoder, InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder) {}
/** /**
* Wrapper for decoder_initialized(). * Wrapper for decoder_initialized().