summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder_stream.cc
diff options
context:
space:
mode:
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());
+}