aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/OpusDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-26 11:33:45 +0200
committerMax Kellermann <max@duempel.org>2014-08-26 11:34:56 +0200
commit26f0f92210b04d58768a9bf100449f05a7c50c09 (patch)
tree7d8f84821a048a36ecbd59a7f6505f9ae6141d9f /src/decoder/plugins/OpusDecoderPlugin.cxx
parentbdc4ae2b86b3ab63053c52f35c0961f4d7fac6e2 (diff)
downloadmpd-26f0f92210b04d58768a9bf100449f05a7c50c09.tar.gz
mpd-26f0f92210b04d58768a9bf100449f05a7c50c09.tar.xz
mpd-26f0f92210b04d58768a9bf100449f05a7c50c09.zip
decoder/opus: use integer seek times
Diffstat (limited to 'src/decoder/plugins/OpusDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/OpusDecoderPlugin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx
index f5a62e0d1..18ccf8183 100644
--- a/src/decoder/plugins/OpusDecoderPlugin.cxx
+++ b/src/decoder/plugins/OpusDecoderPlugin.cxx
@@ -99,7 +99,7 @@ public:
DecoderCommand HandleTags(const ogg_packet &packet);
DecoderCommand HandleAudio(const ogg_packet &packet);
- bool Seek(OggSyncState &oy, double where);
+ bool Seek(OggSyncState &oy, uint64_t where_frame);
};
MPDOpusDecoder::~MPDOpusDecoder()
@@ -328,13 +328,13 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
}
bool
-MPDOpusDecoder::Seek(OggSyncState &oy, double where_s)
+MPDOpusDecoder::Seek(OggSyncState &oy, uint64_t where_frame)
{
assert(eos_granulepos > 0);
assert(input_stream.IsSeekable());
assert(input_stream.KnownSize());
- const ogg_int64_t where_granulepos(where_s * opus_sample_rate);
+ const ogg_int64_t where_granulepos(where_frame);
/* interpolate the file offset where we expect to find the
given granule position */
@@ -365,7 +365,7 @@ mpd_opus_stream_decode(Decoder &decoder,
while (true) {
auto cmd = d.HandlePackets();
if (cmd == DecoderCommand::SEEK) {
- if (d.Seek(oy, decoder_seek_where(decoder)))
+ if (d.Seek(oy, decoder_seek_where_frame(decoder)))
decoder_command_finished(decoder);
else
decoder_seek_error(decoder);