diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-11 13:12:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-11 13:12:43 +0100 |
| commit | bb917533ad5beaded24ed56c7c4dc71d50e76263 (patch) | |
| tree | 3b737fa8110c8113e8ae644568d307700c0eefb9 /src/lib/audio_decoder.cc | |
| parent | 49deab5be257f3a11f5b053224f4a3218fad8da3 (diff) | |
Untested audio delay.
Diffstat (limited to 'src/lib/audio_decoder.cc')
| -rw-r--r-- | src/lib/audio_decoder.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index ade11cc32..2fe347cf2 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -31,15 +31,21 @@ using std::cout; using boost::optional; using boost::shared_ptr; -AudioDecoder::AudioDecoder (shared_ptr<const Film> f) +AudioDecoder::AudioDecoder (shared_ptr<const Film> f, shared_ptr<const AudioContent> c) : Decoder (f) , _audio_position (0) { + _delay_frames = c->audio_delay() * c->content_audio_frame_rate() * f->dcp_audio_frame_rate() / (c->output_audio_frame_rate() * 1000); } void AudioDecoder::audio (shared_ptr<const AudioBuffers> data, AudioContent::Frame frame) { + frame += _delay_frames; + Audio (data, frame); _audio_position = frame + data->frames (); + if (_audio_position < 0) { + _audio_position = 0; + } } |
