diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-17 11:39:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-17 11:39:11 +0100 |
| commit | 7ca384d6b4573d663bc6e60b087dfa61e2f9ab2d (patch) | |
| tree | 9f2861b28884ae528f9d72eb3f0b3e1016fb98cc /src/lib | |
| parent | 492d9ff7353c0ca594333bf4da3cb8ce98439cd2 (diff) | |
Put audio-gap padding in the right place (after the forthcoming audio has been checked and processed).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index f5a9d7b17..569806d83 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -767,6 +767,12 @@ Player::audio_transform (shared_ptr<AudioContent> content, AudioStreamPtr stream content_audio.audio = _audio_processor->run (content_audio.audio, _film->audio_channels ()); } + /* Pad any gap which may be caused by audio delay */ + + if (_last_audio_time) { + fill_audio (DCPTimePeriod (*_last_audio_time, time)); + } + /* Push */ _audio_merger.push (content_audio.audio, time); @@ -803,11 +809,6 @@ Player::audio (weak_ptr<Piece> wp, AudioStreamPtr stream, ContentAudio content_a /* And the end of this block in the DCP */ DCPTime end = time + DCPTime::from_frames(content_audio.audio->frames(), content->resampled_frame_rate()); - /* Pad any gap which may be caused by audio delay */ - if (_last_audio_time) { - fill_audio (DCPTimePeriod (*_last_audio_time, time)); - } - /* Remove anything that comes before the start or after the end of the content */ if (time < piece->content->position()) { pair<shared_ptr<AudioBuffers>, DCPTime> cut = discard_audio (content_audio.audio, time, piece->content->position()); |
