diff options
author | Max Kellermann <max@duempel.org> | 2014-08-26 22:05:02 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-26 22:05:02 +0200 |
commit | 02e697032f7f375e67acc349ada6d849edf51aa3 (patch) | |
tree | 784020ff24b09b12aa51e4c5fee7eb5f9e826c5f /src | |
parent | 07dc26269000819451962ff952701291b4ff365e (diff) | |
download | mpd-02e697032f7f375e67acc349ada6d849edf51aa3.tar.gz mpd-02e697032f7f375e67acc349ada6d849edf51aa3.tar.xz mpd-02e697032f7f375e67acc349ada6d849edf51aa3.zip |
decoder/pcm: use integer seek times
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/plugins/PcmDecoderPlugin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx index f8e02500b..0f41099f2 100644 --- a/src/decoder/plugins/PcmDecoderPlugin.cxx +++ b/src/decoder/plugins/PcmDecoderPlugin.cxx @@ -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)) { |