decoder/Client: use std::chrono::duration<double> instead of raw double
This commit is contained in:
@@ -264,7 +264,8 @@ mpd_mpg123_file_decode(DecoderClient &client, Path path_fs)
|
||||
client.SeekError();
|
||||
else {
|
||||
client.CommandFinished();
|
||||
client.SubmitTimestamp(c / (double)audio_format.sample_rate);
|
||||
client.SubmitTimestamp(FloatDuration(c)
|
||||
/ audio_format.sample_rate);
|
||||
}
|
||||
|
||||
cmd = DecoderCommand::NONE;
|
||||
|
@@ -243,7 +243,7 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
|
||||
throw cmd;
|
||||
|
||||
if (packet.granulepos > 0)
|
||||
client.SubmitTimestamp(double(packet.granulepos)
|
||||
client.SubmitTimestamp(FloatDuration(packet.granulepos)
|
||||
/ opus_sample_rate);
|
||||
}
|
||||
}
|
||||
|
@@ -403,7 +403,7 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
|
||||
const size_t nbytes = result;
|
||||
#endif
|
||||
|
||||
client.SubmitTimestamp((double)player.time() / timebase);
|
||||
client.SubmitTimestamp(FloatDuration(player.time()) / timebase);
|
||||
|
||||
cmd = client.SubmitData(nullptr, buffer, nbytes, 0);
|
||||
|
||||
|
@@ -298,7 +298,7 @@ VorbisDecoder::OnOggPacket(const ogg_packet &_packet)
|
||||
|
||||
#ifndef HAVE_TREMOR
|
||||
if (packet.granulepos > 0)
|
||||
client.SubmitTimestamp(vorbis_granule_time(&dsp, packet.granulepos));
|
||||
client.SubmitTimestamp(FloatDuration(vorbis_granule_time(&dsp, packet.granulepos)));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user