decoder/pcm: use integer seek times
This commit is contained in:
parent
07dc262690
commit
02e697032f
@ -41,6 +41,7 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
|
|||||||
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
|
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
|
||||||
|
|
||||||
const double time_to_size = audio_format.GetTimeToSize();
|
const double time_to_size = audio_format.GetTimeToSize();
|
||||||
|
const auto frame_size = audio_format.GetFrameSize();
|
||||||
|
|
||||||
float total_time = -1;
|
float total_time = -1;
|
||||||
if (is.KnownSize())
|
if (is.KnownSize())
|
||||||
@ -70,8 +71,8 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
|
|||||||
buffer, nbytes, 0)
|
buffer, nbytes, 0)
|
||||||
: decoder_get_command(decoder);
|
: decoder_get_command(decoder);
|
||||||
if (cmd == DecoderCommand::SEEK) {
|
if (cmd == DecoderCommand::SEEK) {
|
||||||
offset_type offset(time_to_size *
|
uint64_t frame = decoder_seek_where_frame(decoder);
|
||||||
decoder_seek_where(decoder));
|
offset_type offset = frame * frame_size;
|
||||||
|
|
||||||
Error error;
|
Error error;
|
||||||
if (is.LockSeek(offset, error)) {
|
if (is.LockSeek(offset, error)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user