X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fwriter.cc;fp=src%2Flib%2Fwriter.cc;h=f9009be37f9779964edc988f184610208d2b0586;hb=392d675f5799671abbcf1a9a47820321bcbdcca2;hp=ca412dd3f5ba7f5f21db2566f9228c73cf497139;hpb=7b83ed2e6aa876636158411b7d12a17a4123a8fa;p=dcpomatic.git diff --git a/src/lib/writer.cc b/src/lib/writer.cc index ca412dd3f..f9009be37 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -268,8 +268,11 @@ Writer::write (shared_ptr audio, DCPTime const time) /* Easy case: we can write all the audio to this reel */ _audio_reel->write (audio); t = end; + } else if (_audio_reel->period().to <= t) { + /* This reel is entirely before the start of our audio; just skip the reel */ + ++_audio_reel; } else { - /* Split the audio into two and write the first part */ + /* This audio is over a reel boundary; split the audio into two and write the first part */ DCPTime part_lengths[2] = { _audio_reel->period().to - t, end - _audio_reel->period().to