decoder/flac: remove "duration" parameter from flac_decoder_initialize()
It's always 0.
This commit is contained in:
parent
e42eed4d4c
commit
79d4f8674c
@ -77,9 +77,7 @@ flac_got_stream_info(struct flac_data *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data->frame_size = data->audio_format.GetFrameSize();
|
data->frame_size = data->audio_format.GetFrameSize();
|
||||||
|
data->total_frames = stream_info->total_samples;
|
||||||
if (data->total_frames == 0)
|
|
||||||
data->total_frames = stream_info->total_samples;
|
|
||||||
|
|
||||||
data->initialized = true;
|
data->initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -132,11 +132,8 @@ flac_decoder_new(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
|
flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd)
|
||||||
FLAC__uint64 duration)
|
|
||||||
{
|
{
|
||||||
data->total_frames = duration;
|
|
||||||
|
|
||||||
if (!FLAC__stream_decoder_process_until_end_of_metadata(sd)) {
|
if (!FLAC__stream_decoder_process_until_end_of_metadata(sd)) {
|
||||||
LogWarning(flac_domain, "problem reading metadata");
|
LogWarning(flac_domain, "problem reading metadata");
|
||||||
return false;
|
return false;
|
||||||
@ -295,7 +292,7 @@ flac_decode_internal(Decoder &decoder,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flac_decoder_initialize(&data, flac_dec, 0)) {
|
if (!flac_decoder_initialize(&data, flac_dec)) {
|
||||||
FLAC__stream_decoder_finish(flac_dec);
|
FLAC__stream_decoder_finish(flac_dec);
|
||||||
FLAC__stream_decoder_delete(flac_dec);
|
FLAC__stream_decoder_delete(flac_dec);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user