Commit 02e69703 authored by Max Kellermann's avatar Max Kellermann

decoder/pcm: use integer seek times

parent 07dc2626
......@@ -41,6 +41,7 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
const double time_to_size = audio_format.GetTimeToSize();
const auto frame_size = audio_format.GetFrameSize();
float total_time = -1;
if (is.KnownSize())
......@@ -70,8 +71,8 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
buffer, nbytes, 0)
: decoder_get_command(decoder);
if (cmd == DecoderCommand::SEEK) {
offset_type offset(time_to_size *
decoder_seek_where(decoder));
uint64_t frame = decoder_seek_where_frame(decoder);
offset_type offset = frame * frame_size;
Error error;
if (is.LockSeek(offset, error)) {
......
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