decoder/flac: remember audio_format, not stream_info
This commit is contained in:
@@ -251,12 +251,12 @@ flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
|
||||
return false;
|
||||
|
||||
if (duration == 0)
|
||||
duration = data->stream_info.total_samples;
|
||||
duration = data->total_frames;
|
||||
|
||||
decoder_initialized(data->decoder, &audio_format,
|
||||
seekable,
|
||||
(float)duration /
|
||||
(float)data->stream_info.sample_rate);
|
||||
(float)data->audio_format.sample_rate);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
|
||||
if (cmd == DECODE_COMMAND_SEEK) {
|
||||
FLAC__uint64 seek_sample = t_start +
|
||||
decoder_seek_where(decoder) *
|
||||
data->stream_info.sample_rate;
|
||||
data->audio_format.sample_rate;
|
||||
if (seek_sample >= t_start &&
|
||||
(t_end == 0 || seek_sample <= t_end) &&
|
||||
FLAC__stream_decoder_seek_absolute(flac_dec, seek_sample)) {
|
||||
|
||||
Reference in New Issue
Block a user