summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-22 17:36:11 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-22 17:36:11 +0100
commit596441a4e8cf03a88113646ca6da2f90e721a38b (patch)
treebf364e57aecc1f019d69b8faf32b8818eaa9d98b /src/lib/audio_decoder.cc
parent11c70b0e3051517e7bb96a7d6fa53053dab6e978 (diff)
Various hacks.
Diffstat (limited to 'src/lib/audio_decoder.cc')
-rw-r--r--src/lib/audio_decoder.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index e1c93ac77..fbc66c335 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -30,6 +30,7 @@ using boost::shared_ptr;
AudioDecoder::AudioDecoder (shared_ptr<const Film> f, shared_ptr<const AudioContent> c)
: Decoder (f)
+ , _next_audio (0)
, _audio_content (c)
, _output_audio_frame_rate (_audio_content->output_audio_frame_rate (f))
{
@@ -104,7 +105,7 @@ AudioDecoder::emit_audio (shared_ptr<const AudioBuffers> data, Time time)
{
/* XXX: map audio to 5.1 */
- /* Maybe sample-rate convert */
+ /* Maybe resample */
if (_swr_context) {
/* Compute the resampled frames count and add 32 for luck */
@@ -128,6 +129,8 @@ AudioDecoder::emit_audio (shared_ptr<const AudioBuffers> data, Time time)
}
Audio (data, time);
+
+ _next_audio = time + _film->audio_frames_to_time (data->frames());
}