From 316c72a4aea4319443e7ea43e06b027f2b7b1ced Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2014 11:02:02 +0200 Subject: DecoderAPI: add decoder_seek_where_ms() Move to fixed-point integers instead of floating point. --- src/decoder/DecoderAPI.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/decoder/DecoderAPI.cxx') diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx index ae600260f..926a3955e 100644 --- a/src/decoder/DecoderAPI.cxx +++ b/src/decoder/DecoderAPI.cxx @@ -220,6 +220,23 @@ double decoder_seek_where(gcc_unused Decoder & decoder) return dc.seek_where; } +unsigned +decoder_seek_where_ms(Decoder &decoder) +{ + const DecoderControl &dc = decoder.dc; + + assert(dc.pipe != nullptr); + + if (decoder.initial_seek_running) + return dc.start_ms; + + assert(dc.command == DecoderCommand::SEEK); + + decoder.seeking = true; + + return unsigned(dc.seek_where * 1000); +} + void decoder_seek_error(Decoder & decoder) { DecoderControl &dc = decoder.dc; -- cgit v1.2.3