decoder/flac: move duplicate code to flac_data::Initialize()

This commit is contained in:
Max Kellermann
2016-07-08 22:44:23 +02:00
parent 475ac76a5f
commit 68064f1aa6
3 changed files with 47 additions and 53 deletions

View File

@@ -54,13 +54,6 @@ struct flac_data : public FlacInput {
*/
AudioFormat audio_format;
/**
* The total number of frames in this song. 0 means unknown.
*
* This attribute is defined if "initialized" is true.
*/
FLAC__uint64 total_frames;
/**
* End of last frame's position within the stream. This is
* used for bit rate calculations.
@@ -73,6 +66,12 @@ struct flac_data : public FlacInput {
Tag tag;
flac_data(Decoder &decoder, InputStream &input_stream);
/**
* Wrapper for decoder_initialized().
*/
bool Initialize(unsigned sample_rate, unsigned bits_per_sample,
unsigned channels, FLAC__uint64 total_frames);
};
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,