summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder_stream.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-08 11:23:58 +0000
committerCarl Hetherington <cth@carlh.net>2016-12-08 11:23:58 +0000
commita28ef704adf8c5bfa45b3d6285f741af64758ceb (patch)
tree04c1afa7b6a72f7faabe290d14713d242b867ab1 /src/lib/audio_decoder_stream.cc
parent804f43474bba7008bf68fc9189793c89c512a944 (diff)
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.
Diffstat (limited to 'src/lib/audio_decoder_stream.cc')
-rw-r--r--src/lib/audio_decoder_stream.cc10
1 files changed, 10 insertions, 0 deletions
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<ContentTime>
+AudioDecoderStream::position () const
+{
+ if (!_position) {
+ return optional<ContentTime> ();
+ }
+
+ return ContentTime::from_frames (_position.get(), _content->resampled_frame_rate());
+}