diff options
Diffstat (limited to 'src/decoder/Bridge.cxx')
-rw-r--r-- | src/decoder/Bridge.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/decoder/Bridge.cxx b/src/decoder/Bridge.cxx index 06e02d24b..08a3c51d5 100644 --- a/src/decoder/Bridge.cxx +++ b/src/decoder/Bridge.cxx @@ -290,7 +290,7 @@ DecoderBridge::CommandFinished() assert(dc.pipe->IsEmpty()); initial_seek_running = false; - timestamp = dc.start_time.ToDoubleS(); + timestamp = std::chrono::duration_cast<FloatDuration>(dc.start_time); absolute_frame = dc.start_time.ToScale<uint64_t>(dc.in_audio_format.sample_rate); return; } @@ -307,7 +307,7 @@ DecoderBridge::CommandFinished() if (convert != nullptr) convert->Reset(); - timestamp = dc.seek_time.ToDoubleS(); + timestamp = std::chrono::duration_cast<FloatDuration>(dc.seek_time); absolute_frame = dc.seek_time.ToScale<uint64_t>(dc.in_audio_format.sample_rate); } @@ -413,12 +413,12 @@ try { } void -DecoderBridge::SubmitTimestamp(double t) +DecoderBridge::SubmitTimestamp(FloatDuration t) { - assert(t >= 0); + assert(t.count() >= 0); timestamp = t; - absolute_frame = uint64_t(t * dc.in_audio_format.sample_rate); + absolute_frame = uint64_t(t.count() * dc.in_audio_format.sample_rate); } DecoderCommand @@ -506,7 +506,7 @@ DecoderBridge::SubmitData(InputStream *is, const auto dest = chunk->Write(dc.out_audio_format, - SongTime::FromS(timestamp) - + SongTime::Cast(timestamp) - dc.song->GetStartTime(), kbit_rate); if (dest.empty()) { @@ -532,8 +532,8 @@ DecoderBridge::SubmitData(InputStream *is, data = (const uint8_t *)data + nbytes; length -= nbytes; - timestamp += (double)nbytes / - dc.out_audio_format.GetTimeToSize(); + timestamp += FloatDuration((double)nbytes / + dc.out_audio_format.GetTimeToSize()); } absolute_frame += data_frames; |