From 79d4f8674c13668e59448579e533bad957bda1d9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Jul 2016 22:38:40 +0200 Subject: [PATCH] decoder/flac: remove "duration" parameter from flac_decoder_initialize() It's always 0. --- src/decoder/plugins/FlacCommon.cxx | 4 +--- src/decoder/plugins/FlacDecoderPlugin.cxx | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/decoder/plugins/FlacCommon.cxx b/src/decoder/plugins/FlacCommon.cxx index 882cfbdb5..a3b1e9184 100644 --- a/src/decoder/plugins/FlacCommon.cxx +++ b/src/decoder/plugins/FlacCommon.cxx @@ -77,9 +77,7 @@ flac_got_stream_info(struct flac_data *data, } data->frame_size = data->audio_format.GetFrameSize(); - - if (data->total_frames == 0) - data->total_frames = stream_info->total_samples; + data->total_frames = stream_info->total_samples; data->initialized = true; } diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx index ff4862e78..25049dfb7 100644 --- a/src/decoder/plugins/FlacDecoderPlugin.cxx +++ b/src/decoder/plugins/FlacDecoderPlugin.cxx @@ -132,11 +132,8 @@ flac_decoder_new(void) } static bool -flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd, - FLAC__uint64 duration) +flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd) { - data->total_frames = duration; - if (!FLAC__stream_decoder_process_until_end_of_metadata(sd)) { LogWarning(flac_domain, "problem reading metadata"); return false; @@ -295,7 +292,7 @@ flac_decode_internal(Decoder &decoder, 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_delete(flac_dec); return;