decoder/flac: late "total_frames" initialization

This commit is contained in:
Max Kellermann 2016-07-08 22:43:01 +02:00
parent 79d4f8674c
commit 475ac76a5f
2 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,7 @@ flac_data::flac_data(Decoder &_decoder,
InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder),
initialized(false), unsupported(false),
total_frames(0), position(0),
position(0),
decoder(_decoder), input_stream(_input_stream)
{
}
@ -142,6 +142,7 @@ flac_got_first_frame(struct flac_data *data, const FLAC__FrameHeader *header)
data->input_stream.IsSeekable(),
duration);
data->total_frames = 0; /* unkown duration */
data->initialized = true;
return true;

View File

@ -56,6 +56,8 @@ struct flac_data : public FlacInput {
/**
* The total number of frames in this song. 0 means unknown.
*
* This attribute is defined if "initialized" is true.
*/
FLAC__uint64 total_frames;