From c463929602252be95ca340b477b7f3b42ff6b0c0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 30 Jan 2018 00:34:13 +0000 Subject: Fix assertion failure in emit_audio. --- src/lib/player.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib') diff --git a/src/lib/player.cc b/src/lib/player.cc index 522b8304f..3d5762740 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -595,6 +595,14 @@ Player::pass () case SILENT: { DCPTimePeriod period (_silent.period_at_position()); + if (_last_audio_time) { + /* Sometimes the thing that happened last finishes fractionally before + this silence. Bodge the start time of the silence to fix it. I'm + not sure if this is the right solution --- maybe the last thing should + be padded `forward' rather than this thing padding `back'. + */ + period.from = min(period.from, *_last_audio_time); + } if (period.duration() > one_video_frame()) { period.to = period.from + one_video_frame(); } -- cgit v1.2.3