Commit 68017b12 authored by Max Kellermann's avatar Max Kellermann

decoder_api: use the correct format to calculate elapsed time

When decoder->timestamp is calculated, the PCM data is already converted to out_audio_format; using in_audio_format may cause funny speedups/slowdowns.
parent 469c9b5d
......@@ -354,7 +354,7 @@ decoder_data(struct decoder *decoder,
length -= nbytes;
decoder->timestamp += (double)nbytes /
audio_format_time_to_size(&dc->in_audio_format);
audio_format_time_to_size(&dc->out_audio_format);
if (dc->song->end_ms > 0 &&
decoder->timestamp >= dc->song->end_ms / 1000.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment