From 7ca384d6b4573d663bc6e60b087dfa61e2f9ab2d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 17 May 2017 11:39:11 +0100 Subject: Put audio-gap padding in the right place (after the forthcoming audio has been checked and processed). --- src/lib/player.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib') 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 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 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, DCPTime> cut = discard_audio (content_audio.audio, time, piece->content->position()); -- cgit v1.2.3