aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decoder/flac_plugin.c4
-rw-r--r--src/decoder/oggflac_plugin.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index cbb95bf45..1841c3f72 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -415,7 +415,7 @@ flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
decoder_initialized(data->decoder, &data->audio_format,
seekable,
(float)duration /
- (float)data->audio_format.sample_rate);
+ (float)data->stream_info.sample_rate);
return true;
}
@@ -440,7 +440,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->audio_format.sample_rate;
+ data->stream_info.sample_rate;
if (seek_sample >= t_start &&
(t_end == 0 || seek_sample <= t_end) &&
FLAC__stream_decoder_seek_absolute(flac_dec, seek_sample)) {
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c
index 6d71c3ad3..14b832bdb 100644
--- a/src/decoder/oggflac_plugin.c
+++ b/src/decoder/oggflac_plugin.c
@@ -318,7 +318,7 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
decoder_initialized(mpd_decoder, &data.audio_format,
input_stream->seekable,
(float)data.stream_info.total_samples /
- (float)data.audio_format.sample_rate);
+ (float)data.stream_info.sample_rate);
while (true) {
OggFLAC__seekable_stream_decoder_process_single(decoder);
@@ -328,7 +328,7 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
}
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
FLAC__uint64 seek_sample = decoder_seek_where(mpd_decoder) *
- data.audio_format.sample_rate + 0.5;
+ data.stream_info.sample_rate;
if (OggFLAC__seekable_stream_decoder_seek_absolute
(decoder, seek_sample)) {
data.next_frame = seek_sample;