Make separate reels for parts of the timeline with no video when
[dcpomatic.git] / test / reels_test.cc
1 /*
2     Copyright (C) 2015-2019 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 /** @file  test/reels_test.cc
22  *  @brief Check manipulation of reels in various ways.
23  *  @ingroup specific
24  */
25
26 #include "lib/film.h"
27 #include "lib/ratio.h"
28 #include "lib/ffmpeg_content.h"
29 #include "lib/image_content.h"
30 #include "lib/dcp_content_type.h"
31 #include "lib/dcp_content.h"
32 #include "lib/video_content.h"
33 #include "lib/string_text_file_content.h"
34 #include "lib/content_factory.h"
35 #include "test.h"
36 #include <boost/test/unit_test.hpp>
37 #include <boost/foreach.hpp>
38 #include <iostream>
39
40 using std::list;
41 using std::cout;
42 using boost::shared_ptr;
43 using namespace dcpomatic;
44
45 /** Test Film::reels() */
46 BOOST_AUTO_TEST_CASE (reels_test1)
47 {
48         shared_ptr<Film> film = new_test_film ("reels_test1");
49         film->set_container (Ratio::from_id ("185"));
50         shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
51         film->examine_and_add_content (A);
52         shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
53         film->examine_and_add_content (B);
54         BOOST_REQUIRE (!wait_for_jobs());
55         BOOST_CHECK_EQUAL (A->full_length(film).get(), 288000);
56
57         film->set_reel_type (REELTYPE_SINGLE);
58         list<DCPTimePeriod> r = film->reels ();
59         BOOST_CHECK_EQUAL (r.size(), 1);
60         BOOST_CHECK_EQUAL (r.front().from.get(), 0);
61         BOOST_CHECK_EQUAL (r.front().to.get(), 288000 * 2);
62
63         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
64         r = film->reels ();
65         BOOST_CHECK_EQUAL (r.size(), 2);
66         BOOST_CHECK_EQUAL (r.front().from.get(), 0);
67         BOOST_CHECK_EQUAL (r.front().to.get(), 288000);
68         BOOST_CHECK_EQUAL (r.back().from.get(), 288000);
69         BOOST_CHECK_EQUAL (r.back().to.get(), 288000 * 2);
70
71         film->set_j2k_bandwidth (100000000);
72         film->set_reel_type (REELTYPE_BY_LENGTH);
73         /* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
74         film->set_reel_length (31253154);
75         r = film->reels ();
76         BOOST_CHECK_EQUAL (r.size(), 3);
77         list<DCPTimePeriod>::const_iterator i = r.begin ();
78         BOOST_CHECK_EQUAL (i->from.get(), 0);
79         BOOST_CHECK_EQUAL (i->to.get(), DCPTime::from_frames(60, 24).get());
80         ++i;
81         BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_frames(60, 24).get());
82         BOOST_CHECK_EQUAL (i->to.get(), DCPTime::from_frames(120, 24).get());
83         ++i;
84         BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_frames(120, 24).get());
85         BOOST_CHECK_EQUAL (i->to.get(), DCPTime::from_frames(144, 24).get());
86 }
87
88 /** Make a short DCP with multi reels split by video content, then import
89  *  this into a new project and make a new DCP referencing it.
90  */
91 BOOST_AUTO_TEST_CASE (reels_test2)
92 {
93         shared_ptr<Film> film = new_test_film ("reels_test2");
94         film->set_name ("reels_test2");
95         film->set_container (Ratio::from_id ("185"));
96         film->set_interop (false);
97         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
98
99         {
100                 shared_ptr<ImageContent> c (new ImageContent("test/data/flat_red.png"));
101                 film->examine_and_add_content (c);
102                 BOOST_REQUIRE (!wait_for_jobs());
103                 c->video->set_length (24);
104         }
105
106         {
107                 shared_ptr<ImageContent> c (new ImageContent("test/data/flat_green.png"));
108                 film->examine_and_add_content (c);
109                 BOOST_REQUIRE (!wait_for_jobs());
110                 c->video->set_length (24);
111         }
112
113         {
114                 shared_ptr<ImageContent> c (new ImageContent("test/data/flat_blue.png"));
115                 film->examine_and_add_content (c);
116                 BOOST_REQUIRE (!wait_for_jobs());
117                 c->video->set_length (24);
118         }
119
120         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
121         BOOST_REQUIRE (!wait_for_jobs());
122
123         film->make_dcp ();
124         BOOST_REQUIRE (!wait_for_jobs());
125
126         check_dcp ("test/data/reels_test2", film->dir (film->dcp_name()));
127
128         shared_ptr<Film> film2 = new_test_film ("reels_test2b");
129         film2->set_name ("reels_test2b");
130         film2->set_container (Ratio::from_id ("185"));
131         film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
132         film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
133
134         shared_ptr<DCPContent> c (new DCPContent(film->dir(film->dcp_name())));
135         film2->examine_and_add_content (c);
136         BOOST_REQUIRE (!wait_for_jobs ());
137
138         list<DCPTimePeriod> r = film2->reels ();
139         BOOST_CHECK_EQUAL (r.size(), 3);
140         list<DCPTimePeriod>::const_iterator i = r.begin ();
141         BOOST_CHECK_EQUAL (i->from.get(), 0);
142         BOOST_CHECK_EQUAL (i->to.get(), 96000);
143         ++i;
144         BOOST_CHECK_EQUAL (i->from.get(), 96000);
145         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 2);
146         ++i;
147         BOOST_CHECK_EQUAL (i->from.get(), 96000 * 2);
148         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
149
150         c->set_reference_video (true);
151         c->set_reference_audio (true);
152
153         film2->make_dcp ();
154         BOOST_REQUIRE (!wait_for_jobs());
155 }
156
157 /** Check that REELTYPE_BY_VIDEO_CONTENT adds an extra reel, if necessary, at the end
158  *  of all the video content to mop up anything afterward.
159  */
160 BOOST_AUTO_TEST_CASE (reels_test3)
161 {
162         shared_ptr<Film> film = new_test_film ("reels_test3");
163         film->set_name ("reels_test3");
164         film->set_container (Ratio::from_id ("185"));
165         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
166         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
167
168         shared_ptr<Content> dcp (new DCPContent("test/data/reels_test2"));
169         film->examine_and_add_content (dcp);
170         shared_ptr<Content> sub (new StringTextFileContent("test/data/subrip.srt"));
171         film->examine_and_add_content (sub);
172         BOOST_REQUIRE (!wait_for_jobs());
173
174         list<DCPTimePeriod> reels = film->reels();
175         BOOST_REQUIRE_EQUAL (reels.size(), 4);
176         list<DCPTimePeriod>::const_iterator i = reels.begin ();
177         BOOST_CHECK_EQUAL (i->from.get(), 0);
178         BOOST_CHECK_EQUAL (i->to.get(), 96000);
179         ++i;
180         BOOST_CHECK_EQUAL (i->from.get(), 96000);
181         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 2);
182         ++i;
183         BOOST_CHECK_EQUAL (i->from.get(), 96000 * 2);
184         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
185         ++i;
186         BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
187         BOOST_CHECK_EQUAL (i->to.get(), sub->full_length(film).ceil(film->video_frame_rate()).get());
188 }
189
190 /** Check creation of a multi-reel DCP with a single .srt subtitle file;
191  *  make sure that the reel subtitle timing is done right.
192  */
193 BOOST_AUTO_TEST_CASE (reels_test4)
194 {
195         shared_ptr<Film> film = new_test_film ("reels_test4");
196         film->set_name ("reels_test4");
197         film->set_container (Ratio::from_id ("185"));
198         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
199         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
200         film->set_interop (false);
201
202         /* 4 piece of 1s-long content */
203         shared_ptr<ImageContent> content[4];
204         for (int i = 0; i < 4; ++i) {
205                 content[i].reset (new ImageContent("test/data/flat_green.png"));
206                 film->examine_and_add_content (content[i]);
207                 BOOST_REQUIRE (!wait_for_jobs());
208                 content[i]->video->set_length (24);
209         }
210
211         shared_ptr<StringTextFileContent> subs (new StringTextFileContent("test/data/subrip3.srt"));
212         film->examine_and_add_content (subs);
213         BOOST_REQUIRE (!wait_for_jobs());
214
215         list<DCPTimePeriod> reels = film->reels();
216         BOOST_REQUIRE_EQUAL (reels.size(), 4);
217         list<DCPTimePeriod>::const_iterator i = reels.begin ();
218         BOOST_CHECK_EQUAL (i->from.get(), 0);
219         BOOST_CHECK_EQUAL (i->to.get(), 96000);
220         ++i;
221         BOOST_CHECK_EQUAL (i->from.get(), 96000);
222         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 2);
223         ++i;
224         BOOST_CHECK_EQUAL (i->from.get(), 96000 * 2);
225         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
226         ++i;
227         BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
228         BOOST_CHECK_EQUAL (i->to.get(), 96000 * 4);
229
230         film->make_dcp ();
231         BOOST_REQUIRE (!wait_for_jobs());
232
233         check_dcp ("test/data/reels_test4", film->dir (film->dcp_name()));
234 }
235
236 BOOST_AUTO_TEST_CASE (reels_test5)
237 {
238         shared_ptr<Film> film = new_test_film ("reels_test5");
239         film->set_sequence (false);
240         shared_ptr<DCPContent> dcp (new DCPContent("test/data/reels_test4"));
241         film->examine_and_add_content (dcp);
242         BOOST_REQUIRE (!wait_for_jobs ());
243
244         /* Set to 2123 but it will be rounded up to the next frame (4000) */
245         dcp->set_position(film, DCPTime(2123));
246
247         {
248                 list<DCPTimePeriod> p = dcp->reels (film);
249                 BOOST_REQUIRE_EQUAL (p.size(), 4);
250                 list<DCPTimePeriod>::const_iterator i = p.begin();
251                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 96000)));
252                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 96000), DCPTime(4000 + 192000)));
253                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 192000), DCPTime(4000 + 288000)));
254                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 288000), DCPTime(4000 + 384000)));
255         }
256
257         {
258                 dcp->set_trim_start (ContentTime::from_seconds (0.5));
259                 list<DCPTimePeriod> p = dcp->reels (film);
260                 BOOST_REQUIRE_EQUAL (p.size(), 4);
261                 list<DCPTimePeriod>::const_iterator i = p.begin();
262                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
263                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
264                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 240000)));
265                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 240000), DCPTime(4000 + 336000)));
266         }
267
268         {
269                 dcp->set_trim_end (ContentTime::from_seconds (0.5));
270                 list<DCPTimePeriod> p = dcp->reels (film);
271                 BOOST_REQUIRE_EQUAL (p.size(), 4);
272                 list<DCPTimePeriod>::const_iterator i = p.begin();
273                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
274                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
275                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 240000)));
276                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 240000), DCPTime(4000 + 288000)));
277         }
278
279         {
280                 dcp->set_trim_start (ContentTime::from_seconds (1.5));
281                 list<DCPTimePeriod> p = dcp->reels (film);
282                 BOOST_REQUIRE_EQUAL (p.size(), 3);
283                 list<DCPTimePeriod>::const_iterator i = p.begin();
284                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
285                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
286                 BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 192000)));
287         }
288 }
289
290 /** Check reel split with a muxed video/audio source */
291 BOOST_AUTO_TEST_CASE (reels_test6)
292 {
293         shared_ptr<Film> film = new_test_film ("reels_test6");
294         film->set_name ("reels_test6");
295         film->set_container (Ratio::from_id ("185"));
296         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
297         shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test2.mp4"));
298         film->examine_and_add_content (A);
299         BOOST_REQUIRE (!wait_for_jobs ());
300
301         film->set_j2k_bandwidth (100000000);
302         film->set_reel_type (REELTYPE_BY_LENGTH);
303         /* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
304         film->set_reel_length (31253154);
305         film->make_dcp ();
306         BOOST_REQUIRE (!wait_for_jobs ());
307 }
308
309 /** Check the case where the last bit of audio hangs over the end of the video
310  *  and we are using REELTYPE_BY_VIDEO_CONTENT.
311  */
312 BOOST_AUTO_TEST_CASE (reels_test7)
313 {
314         shared_ptr<Film> film = new_test_film ("reels_test7");
315         film->set_name ("reels_test7");
316         film->set_container (Ratio::from_id ("185"));
317         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
318         shared_ptr<Content> A = content_factory("test/data/flat_red.png").front();
319         film->examine_and_add_content (A);
320         BOOST_REQUIRE (!wait_for_jobs ());
321         shared_ptr<Content> B = content_factory("test/data/awkward_length.wav").front();
322         film->examine_and_add_content (B);
323         BOOST_REQUIRE (!wait_for_jobs ());
324         film->set_video_frame_rate (24);
325         A->video->set_length (3 * 24);
326
327         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
328         BOOST_REQUIRE_EQUAL (film->reels().size(), 2);
329         BOOST_CHECK (film->reels().front() == DCPTimePeriod(DCPTime(0), DCPTime::from_frames(3 * 24, 24)));
330         BOOST_CHECK (film->reels().back() == DCPTimePeriod(DCPTime::from_frames(3 * 24, 24), DCPTime::from_frames(3 * 24 + 1, 24)));
331
332         film->make_dcp ();
333         BOOST_REQUIRE (!wait_for_jobs ());
334 }
335
336 /** Check a reels-related error; make_dcp() would raise a ProgrammingError */
337 BOOST_AUTO_TEST_CASE (reels_test8)
338 {
339         shared_ptr<Film> film = new_test_film ("reels_test8");
340         film->set_name ("reels_test8");
341         film->set_container (Ratio::from_id ("185"));
342         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
343         shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test2.mp4"));
344         film->examine_and_add_content (A);
345         BOOST_REQUIRE (!wait_for_jobs ());
346
347         A->set_trim_end (ContentTime::from_seconds (1));
348         film->make_dcp ();
349         BOOST_REQUIRE (!wait_for_jobs ());
350 }
351
352 /** Check another reels-related error; make_dcp() would raise a ProgrammingError */
353 BOOST_AUTO_TEST_CASE (reels_test9)
354 {
355         shared_ptr<Film> film = new_test_film2("reels_test9a");
356         shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
357         film->examine_and_add_content(A);
358         BOOST_REQUIRE(!wait_for_jobs());
359         A->video->set_length(5 * 24);
360         film->set_video_frame_rate(24);
361         film->make_dcp();
362         BOOST_REQUIRE(!wait_for_jobs());
363
364         shared_ptr<Film> film2 = new_test_film2("reels_test9b");
365         shared_ptr<DCPContent> B(new DCPContent(film->dir(film->dcp_name())));
366         film2->examine_and_add_content(B);
367         film2->examine_and_add_content(content_factory("test/data/dcp_sub4.xml").front());
368         B->set_reference_video(true);
369         B->set_reference_audio(true);
370         BOOST_REQUIRE(!wait_for_jobs());
371         film2->set_reel_type(REELTYPE_BY_VIDEO_CONTENT);
372         film2->write_metadata();
373         film2->make_dcp();
374         BOOST_REQUIRE(!wait_for_jobs());
375 }
376
377 /** Another reels-related error; make_dcp() would raise a ProgrammingError
378  *  in AudioBuffers::allocate due to an attempt to allocate a negatively-sized buffer.
379  *  This was triggered by a VF where there are referenced audio reels followed by
380  *  VF audio.  When the VF audio arrives the Writer did not correctly skip over the
381  *  referenced reels.
382  */
383 BOOST_AUTO_TEST_CASE (reels_test10)
384 {
385         /* Make the OV */
386         shared_ptr<Film> ov = new_test_film2("reels_test10_ov");
387         shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
388         ov->examine_and_add_content (A);
389         BOOST_REQUIRE (!wait_for_jobs());
390         A->video->set_length (5 * 24);
391
392         shared_ptr<FFmpegContent> B(new FFmpegContent("test/data/flat_red.png"));
393         ov->examine_and_add_content (B);
394         BOOST_REQUIRE (!wait_for_jobs());
395         B->video->set_length (5 * 24);
396
397         ov->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
398         ov->make_dcp ();
399         BOOST_REQUIRE (!wait_for_jobs());
400         ov->write_metadata ();
401
402         /* Now try to make the VF; this used to fail */
403         shared_ptr<Film> vf = new_test_film2("reels_test10_vf");
404         shared_ptr<DCPContent> ov_dcp(new DCPContent(ov->dir(ov->dcp_name())));
405         vf->examine_and_add_content (ov_dcp);
406         BOOST_REQUIRE (!wait_for_jobs());
407         vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
408         ov_dcp->set_reference_video (true);
409         ov_dcp->set_reference_audio (true);
410         vf->examine_and_add_content (content_factory("test/data/15s.srt").front());
411         BOOST_REQUIRE (!wait_for_jobs());
412
413         vf->make_dcp ();
414         BOOST_REQUIRE (!wait_for_jobs());
415         vf->write_metadata ();
416 }
417
418 /** Another reels error; REELTYPE_BY_VIDEO_CONTENT when the first content is not
419  *  at time 0.
420  */
421 BOOST_AUTO_TEST_CASE (reels_test11)
422 {
423         shared_ptr<Film> film = new_test_film2 ("reels_test11");
424         film->set_video_frame_rate (24);
425         shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
426         film->examine_and_add_content (A);
427         BOOST_REQUIRE (!wait_for_jobs());
428         A->video->set_length (240);
429         A->set_video_frame_rate (24);
430         A->set_position (film, DCPTime::from_seconds(1));
431         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
432         film->make_dcp ();
433         BOOST_REQUIRE (!wait_for_jobs());
434         BOOST_CHECK_EQUAL (A->position().get(), DCPTime::from_seconds(1).get());
435         BOOST_CHECK_EQUAL (A->end(film).get(), DCPTime::from_seconds(1 + 10).get());
436
437         list<DCPTimePeriod> r = film->reels ();
438         BOOST_CHECK_EQUAL (r.size(), 2);
439         BOOST_CHECK_EQUAL (r.front().from.get(), 0);
440         BOOST_CHECK_EQUAL (r.front().to.get(), DCPTime::from_seconds(1).get());
441         BOOST_CHECK_EQUAL (r.back().from.get(), DCPTime::from_seconds(1).get());
442         BOOST_CHECK_EQUAL (r.back().to.get(), DCPTime::from_seconds(1 + 10).get());
443 }
444
445 /** For VFs to work right we have to make separate reels for empty bits between
446  *  video content.
447  */
448 BOOST_AUTO_TEST_CASE (reels_test12)
449 {
450         shared_ptr<Film> film = new_test_film2 ("reels_test12");
451         film->set_video_frame_rate (24);
452         film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
453         film->set_sequence (false);
454
455         shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
456         film->examine_and_add_content (A);
457         BOOST_REQUIRE (!wait_for_jobs());
458         A->video->set_length (240);
459         A->set_video_frame_rate (24);
460         A->set_position (film, DCPTime::from_seconds(1));
461
462         shared_ptr<FFmpegContent> B(new FFmpegContent("test/data/flat_red.png"));
463         film->examine_and_add_content (B);
464         BOOST_REQUIRE (!wait_for_jobs());
465         B->video->set_length (120);
466         B->set_video_frame_rate (24);
467         B->set_position (film, DCPTime::from_seconds(14));
468
469         list<DCPTimePeriod> r = film->reels ();
470         BOOST_REQUIRE_EQUAL (r.size(), 4);
471         list<DCPTimePeriod>::const_iterator i = r.begin ();
472
473         BOOST_CHECK_EQUAL (i->from.get(), 0);
474         BOOST_CHECK_EQUAL (i->to.get(),   DCPTime::from_seconds(1).get());
475         ++i;
476         BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_seconds(1).get());
477         BOOST_CHECK_EQUAL (i->to.get(),   DCPTime::from_seconds(11).get());
478         ++i;
479         BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_seconds(11).get());
480         BOOST_CHECK_EQUAL (i->to.get(),   DCPTime::from_seconds(14).get());
481         ++i;
482         BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_seconds(14).get());
483         BOOST_CHECK_EQUAL (i->to.get(),   DCPTime::from_seconds(19).get());
484 }