From a28ef704adf8c5bfa45b3d6285f741af64758ceb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 8 Dec 2016 11:23:58 +0000 Subject: Further fixes and tidying to 'better-seek'. This fixes the failure to keep track of the `position' of each stream of a multi-stream file. It also tidies things up a bit. --- src/lib/audio_decoder_stream.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib/audio_decoder_stream.cc') diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index af46593ab..a82ebc4cf 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -272,3 +272,13 @@ AudioDecoderStream::set_fast () _resampler->set_fast (); } } + +optional +AudioDecoderStream::position () const +{ + if (!_position) { + return optional (); + } + + return ContentTime::from_frames (_position.get(), _content->resampled_frame_rate()); +} -- cgit v1.2.3