X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.cc;h=c88be58266251da86ecb85a91ea3d2e96b4426f7;hb=e0b2ef3dbac6fc4900cad6fea4395c212578602b;hp=23fe65cf4c8fcfd9448975d1b050edc7f787c8cb;hpb=2cdf3d9f461b12d0925cc54368105bbd177bbbb3;p=dcpomatic.git diff --git a/src/lib/player.cc b/src/lib/player.cc index 23fe65cf4..c88be5826 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -614,12 +614,12 @@ Player::pass () which = CONTENT; } - if (!_black.done() && (!earliest_time || _black.position() < *earliest_time)) { + if (!_black.done() && !_ignore_video && (!earliest_time || _black.position() < *earliest_time)) { earliest_time = _black.position (); which = BLACK; } - if (!_silent.done() && (!earliest_time || _silent.position() < *earliest_time)) { + if (!_silent.done() && !_ignore_audio && (!earliest_time || _silent.position() < *earliest_time)) { earliest_time = _silent.position (); which = SILENT; } @@ -648,8 +648,15 @@ Player::pass () if (_last_audio_time) { /* Sometimes the thing that happened last finishes fractionally before or after this silence. Bodge the start time of the silence to fix it. + I think this is nothing to worry about since we will just add or + remove a little silence at the end of some content. */ - DCPOMATIC_ASSERT (labs(period.from.get() - _last_audio_time->get()) < 2); + int64_t const error = labs(period.from.get() - _last_audio_time->get()); + int64_t const too_much_error = 4; + if (error >= too_much_error) { + _film->log()->log(String::compose("Silence starting before or after last audio by %1", error), LogEntry::TYPE_ERROR); + } + DCPOMATIC_ASSERT (error < too_much_error); period.from = *_last_audio_time; } if (period.duration() > one_video_frame()) {