Add a warning log when an assertion gets hit.
authorCarl Hetherington <cth@carlh.net>
Thu, 19 Sep 2019 22:11:25 +0000 (00:11 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 19 Sep 2019 22:28:24 +0000 (00:28 +0200)
src/lib/player.cc

index 38c4beaae463b982b0f4e889f0e6184c47d55c9f..cc8556f3d61d399d08b4ecdf50476f3d55b502a8 100644 (file)
@@ -636,7 +636,11 @@ Player::pass ()
                        /* Sometimes the thing that happened last finishes fractionally before
                           or after this silence.  Bodge the start time of the silence to fix it.
                        */
-                       DCPOMATIC_ASSERT (labs(period.from.get() - _last_audio_time->get()) < 2);
+                       int64_t const error = labs(period.from.get() - _last_audio_time->get());
+                       if (error >= 2) {
+                               _film->log()->log(String::compose("Silence starting before or after last audio by %1", error), LogEntry::TYPE_ERROR);
+                       }
+                       DCPOMATIC_ASSERT (error < 2);
                        period.from = *_last_audio_time;
                }
                if (period.duration() > one_video_frame()) {