Extend the amount of allowed disagreement between the audio
[dcpomatic.git] / src / lib / player.cc
index cc8556f3d61d399d08b4ecdf50476f3d55b502a8..fe08241ab8258bca5ec05cf8865472ef584cc941 100644 (file)
@@ -635,12 +635,16 @@ 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.
                        */
                        int64_t const error = labs(period.from.get() - _last_audio_time->get());
-                       if (error >= 2) {
+                       /* Let's not worry about less than a frame at 24fps */
+                       int64_t const too_much_error = DCPTime::from_frames(1, 24).get();
+                       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 < 2);
+                       DCPOMATIC_ASSERT (error < too_much_error);
                        period.from = *_last_audio_time;
                }
                if (period.duration() > one_video_frame()) {