Add log for assertion failure.
authorCarl Hetherington <cth@carlh.net>
Fri, 16 Feb 2018 23:52:39 +0000 (23:52 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 16 Feb 2018 23:52:39 +0000 (23:52 +0000)
src/lib/player.cc

index 0f20dc7ecbd81cf44aa056239de999caca719c83..71b04e7b2851efc8e3ef61c97722031d67f6d973 100644 (file)
@@ -989,6 +989,11 @@ Player::emit_video (shared_ptr<PlayerVideo> pv, DCPTime time)
 void
 Player::emit_audio (shared_ptr<AudioBuffers> data, DCPTime time)
 {
+       /* Log if the assert below is about to fail */
+       if (_last_audio_time && time != *_last_audio_time) {
+               _film->log()->log(String::compose("Out-of-sequence emit %1 vs %2", to_string(time), to_string(*_last_audio_time)), LogEntry::TYPE_WARNING);
+       }
+
        /* This audio must follow on from the previous */
        DCPOMATIC_ASSERT (!_last_audio_time || time == *_last_audio_time);
        Audio (data, time);