Noisy change to get film into AudioContent::modify_trim_start().
[dcpomatic.git] / test / player_test.cc
1 /*
2     Copyright (C) 2014-2021 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
22 /** @file  test/player_test.cc
23  *  @brief Test Player class.
24  *  @ingroup selfcontained
25  */
26
27
28 #include "lib/audio_buffers.h"
29 #include "lib/audio_content.h"
30 #include "lib/butler.h"
31 #include "lib/compose.hpp"
32 #include "lib/config.h"
33 #include "lib/content_factory.h"
34 #include "lib/cross.h"
35 #include "lib/dcp_content.h"
36 #include "lib/dcp_content_type.h"
37 #include "lib/dcpomatic_log.h"
38 #include "lib/ffmpeg_content.h"
39 #include "lib/film.h"
40 #include "lib/image_content.h"
41 #include "lib/player.h"
42 #include "lib/ratio.h"
43 #include "lib/string_text_file_content.h"
44 #include "lib/text_content.h"
45 #include "lib/video_content.h"
46 #include "test.h"
47 #include <boost/test/unit_test.hpp>
48 #include <boost/algorithm/string.hpp>
49 #include <iostream>
50
51
52 using std::cout;
53 using std::list;
54 using std::shared_ptr;
55 using std::make_shared;
56 using boost::bind;
57 using boost::optional;
58 #if BOOST_VERSION >= 106100
59 using namespace boost::placeholders;
60 #endif
61 using namespace dcpomatic;
62
63
64 static shared_ptr<AudioBuffers> accumulated;
65
66
67 static void
68 accumulate (shared_ptr<AudioBuffers> audio, DCPTime)
69 {
70         BOOST_REQUIRE (accumulated);
71         accumulated->append (audio);
72 }
73
74
75 /** Check that the Player correctly generates silence when used with a silent FFmpegContent */
76 BOOST_AUTO_TEST_CASE (player_silence_padding_test)
77 {
78         auto film = new_test_film ("player_silence_padding_test");
79         film->set_name ("player_silence_padding_test");
80         auto c = std::make_shared<FFmpegContent>("test/data/test.mp4");
81         film->set_container (Ratio::from_id ("185"));
82         film->set_audio_channels (6);
83
84         film->examine_and_add_content (c);
85         BOOST_REQUIRE (!wait_for_jobs());
86
87         accumulated = std::make_shared<AudioBuffers>(film->audio_channels(), 0);
88
89         Player player(film, Image::Alignment::COMPACT);
90         player.Audio.connect(bind(&accumulate, _1, _2));
91         while (!player.pass()) {}
92         BOOST_REQUIRE (accumulated->frames() >= 48000);
93         BOOST_CHECK_EQUAL (accumulated->channels(), film->audio_channels ());
94
95         for (int i = 0; i < 48000; ++i) {
96                 for (int c = 0; c < accumulated->channels(); ++c) {
97                         BOOST_CHECK_EQUAL (accumulated->data()[c][i], 0);
98                 }
99         }
100 }
101
102
103 /* Test insertion of black frames between separate bits of video content */
104 BOOST_AUTO_TEST_CASE (player_black_fill_test)
105 {
106         auto film = new_test_film ("black_fill_test");
107         film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
108         film->set_name ("black_fill_test");
109         film->set_container (Ratio::from_id ("185"));
110         film->set_sequence (false);
111         film->set_interop (false);
112         auto contentA = std::make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
113         auto contentB = std::make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
114
115         film->examine_and_add_content (contentA);
116         film->examine_and_add_content (contentB);
117         BOOST_REQUIRE (!wait_for_jobs());
118
119         contentA->video->set_length (3);
120         contentA->set_position (film, DCPTime::from_frames(2, film->video_frame_rate()));
121         contentA->video->set_custom_ratio (1.85);
122         contentB->video->set_length (1);
123         contentB->set_position (film, DCPTime::from_frames(7, film->video_frame_rate()));
124         contentB->video->set_custom_ratio (1.85);
125
126         make_and_verify_dcp (
127                 film,
128                 {
129                         dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE,
130                         dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE
131                 });
132
133         boost::filesystem::path ref;
134         ref = "test";
135         ref /= "data";
136         ref /= "black_fill_test";
137
138         boost::filesystem::path check;
139         check = "build";
140         check /= "test";
141         check /= "black_fill_test";
142         check /= film->dcp_name();
143
144         check_dcp (ref.string(), check.string());
145 }
146
147
148 /** Check behaviour with an awkward playlist whose data does not end on a video frame start */
149 BOOST_AUTO_TEST_CASE (player_subframe_test)
150 {
151         auto film = new_test_film ("reels_test7");
152         film->set_name ("reels_test7");
153         film->set_container (Ratio::from_id("185"));
154         film->set_dcp_content_type (DCPContentType::from_isdcf_name("TST"));
155         auto A = content_factory("test/data/flat_red.png")[0];
156         film->examine_and_add_content (A);
157         BOOST_REQUIRE (!wait_for_jobs());
158         auto B = content_factory("test/data/awkward_length.wav")[0];
159         film->examine_and_add_content (B);
160         BOOST_REQUIRE (!wait_for_jobs());
161         film->set_video_frame_rate (24);
162         A->video->set_length (3 * 24);
163
164         BOOST_CHECK (A->full_length(film) == DCPTime::from_frames(3 * 24, 24));
165         BOOST_CHECK (B->full_length(film) == DCPTime(289920));
166         /* Length should be rounded up from B's length to the next video frame */
167         BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24));
168
169         Player player(film, Image::Alignment::COMPACT);
170         player.setup_pieces();
171         BOOST_REQUIRE_EQUAL(player._black._periods.size(), 1U);
172         BOOST_CHECK(player._black._periods.front() == DCPTimePeriod(DCPTime::from_frames(3 * 24, 24), DCPTime::from_frames(3 * 24 + 1, 24)));
173         BOOST_REQUIRE_EQUAL(player._silent._periods.size(), 1U);
174         BOOST_CHECK(player._silent._periods.front() == DCPTimePeriod(DCPTime(289920), DCPTime::from_frames(3 * 24 + 1, 24)));
175 }
176
177
178 static Frame video_frames;
179 static Frame audio_frames;
180
181
182 static void
183 video (shared_ptr<PlayerVideo>, DCPTime)
184 {
185         ++video_frames;
186 }
187
188 static void
189 audio (shared_ptr<AudioBuffers> audio, DCPTime)
190 {
191         audio_frames += audio->frames();
192 }
193
194
195 /** Check with a video-only file that the video and audio emissions happen more-or-less together */
196 BOOST_AUTO_TEST_CASE (player_interleave_test)
197 {
198         auto film = new_test_film ("ffmpeg_transcoder_basic_test_subs");
199         film->set_name ("ffmpeg_transcoder_basic_test");
200         film->set_container (Ratio::from_id ("185"));
201         film->set_audio_channels (6);
202
203         auto c = std::make_shared<FFmpegContent>("test/data/test.mp4");
204         film->examine_and_add_content (c);
205         BOOST_REQUIRE (!wait_for_jobs ());
206
207         auto s = std::make_shared<StringTextFileContent>("test/data/subrip.srt");
208         film->examine_and_add_content (s);
209         BOOST_REQUIRE (!wait_for_jobs ());
210
211         Player player(film, Image::Alignment::COMPACT);
212         player.Video.connect(bind(&video, _1, _2));
213         player.Audio.connect(bind(&audio, _1, _2));
214         video_frames = audio_frames = 0;
215         while (!player.pass()) {
216                 BOOST_CHECK (abs(video_frames - (audio_frames / 2000)) <= 8);
217         }
218 }
219
220
221 /** Test some seeks towards the start of a DCP with awkward subtitles; see mantis #1085
222  *  and a number of others.  I thought this was a player seek bug but in fact it was
223  *  caused by the subtitle starting just after the start of the video frame and hence
224  *  being faded out.
225  */
226 BOOST_AUTO_TEST_CASE (player_seek_test)
227 {
228         auto film = std::make_shared<Film>(optional<boost::filesystem::path>());
229         auto dcp = std::make_shared<DCPContent>(TestPaths::private_data() / "awkward_subs");
230         film->examine_and_add_content (dcp, true);
231         BOOST_REQUIRE (!wait_for_jobs ());
232         dcp->only_text()->set_use (true);
233
234         Player player(film, Image::Alignment::COMPACT);
235         player.set_fast();
236         player.set_always_burn_open_subtitles();
237         player.set_play_referenced();
238
239         auto butler = std::make_shared<Butler>(
240                 film, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false, Butler::Audio::DISABLED
241                 );
242
243         for (int i = 0; i < 10; ++i) {
244                 auto t = DCPTime::from_frames (i, 24);
245                 butler->seek (t, true);
246                 auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
247                 BOOST_CHECK_EQUAL(video.second.get(), t.get());
248                 write_image(video.first->image(bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test_%1.png", i));
249                 /* This 14.08 is empirically chosen (hopefully) to accept changes in rendering between the reference and a test machine
250                    (17.10 and 16.04 seem to anti-alias a little differently) but to reject gross errors e.g. missing fonts or missing
251                    text altogether.
252                 */
253                 check_image(TestPaths::private_data() / String::compose("player_seek_test_%1.png", i), String::compose("build/test/player_seek_test_%1.png", i), 14.08);
254         }
255 }
256
257
258 /** Test some more seeks towards the start of a DCP with awkward subtitles */
259 BOOST_AUTO_TEST_CASE (player_seek_test2)
260 {
261         auto film = std::make_shared<Film>(optional<boost::filesystem::path>());
262         auto dcp = std::make_shared<DCPContent>(TestPaths::private_data() / "awkward_subs2");
263         film->examine_and_add_content (dcp, true);
264         BOOST_REQUIRE (!wait_for_jobs ());
265         dcp->only_text()->set_use (true);
266
267         Player player(film, Image::Alignment::COMPACT);
268         player.set_fast();
269         player.set_always_burn_open_subtitles();
270         player.set_play_referenced();
271
272         auto butler = std::make_shared<Butler>
273                 (film, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false, Butler::Audio::DISABLED
274                  );
275
276         butler->seek(DCPTime::from_seconds(5), true);
277
278         for (int i = 0; i < 10; ++i) {
279                 auto t = DCPTime::from_seconds(5) + DCPTime::from_frames (i, 24);
280                 butler->seek (t, true);
281                 auto video = butler->get_video(Butler::Behaviour::BLOCKING, 0);
282                 BOOST_CHECK_EQUAL(video.second.get(), t.get());
283                 write_image(
284                         video.first->image(bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true), String::compose("build/test/player_seek_test2_%1.png", i)
285                         );
286                 check_image(TestPaths::private_data() / String::compose("player_seek_test2_%1.png", i), String::compose("build/test/player_seek_test2_%1.png", i), 14.08);
287         }
288 }
289
290
291 /** Test a bug when trimmed content follows other content */
292 BOOST_AUTO_TEST_CASE (player_trim_test)
293 {
294        auto film = new_test_film2 ("player_trim_test");
295        auto A = content_factory("test/data/flat_red.png")[0];
296        film->examine_and_add_content (A);
297        BOOST_REQUIRE (!wait_for_jobs ());
298        A->video->set_length (10 * 24);
299        auto B = content_factory("test/data/flat_red.png")[0];
300        film->examine_and_add_content (B);
301        BOOST_REQUIRE (!wait_for_jobs ());
302        B->video->set_length (10 * 24);
303        B->set_position (film, DCPTime::from_seconds(10));
304        B->set_trim_start(film, ContentTime::from_seconds(2));
305
306        make_and_verify_dcp (film);
307 }
308
309
310 struct Sub {
311         PlayerText text;
312         TextType type;
313         optional<DCPTextTrack> track;
314         DCPTimePeriod period;
315 };
316
317
318 static void
319 store (list<Sub>* out, PlayerText text, TextType type, optional<DCPTextTrack> track, DCPTimePeriod period)
320 {
321         Sub s;
322         s.text = text;
323         s.type = type;
324         s.track = track;
325         s.period = period;
326         out->push_back (s);
327 }
328
329
330 /** Test ignoring both video and audio */
331 BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
332 {
333         auto film = new_test_film2 ("player_ignore_video_and_audio_test");
334         auto ff = content_factory(TestPaths::private_data() / "boon_telly.mkv")[0];
335         film->examine_and_add_content (ff);
336         auto text = content_factory("test/data/subrip.srt")[0];
337         film->examine_and_add_content (text);
338         BOOST_REQUIRE (!wait_for_jobs());
339         text->only_text()->set_type (TextType::CLOSED_CAPTION);
340         text->only_text()->set_use (true);
341
342         Player player(film, Image::Alignment::COMPACT);
343         player.set_ignore_video();
344         player.set_ignore_audio();
345
346         list<Sub> out;
347         player.Text.connect(bind (&store, &out, _1, _2, _3, _4));
348         while (!player.pass()) {}
349
350         BOOST_CHECK_EQUAL (out.size(), 6U);
351 }
352
353
354 /** Trigger a crash due to the assertion failure in Player::emit_audio */
355 BOOST_AUTO_TEST_CASE (player_trim_crash)
356 {
357         auto film = new_test_film2 ("player_trim_crash");
358         auto boon = content_factory(TestPaths::private_data() / "boon_telly.mkv")[0];
359         film->examine_and_add_content (boon);
360         BOOST_REQUIRE (!wait_for_jobs());
361
362         Player player(film, Image::Alignment::COMPACT);
363         player.set_fast();
364         auto butler = std::make_shared<Butler>(
365                 film, player, AudioMapping(), 6, bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, true, false, Butler::Audio::ENABLED
366                 );
367
368         /* Wait for the butler to fill */
369         dcpomatic_sleep_seconds (5);
370
371         boon->set_trim_start(film, ContentTime::from_seconds(5));
372
373         butler->seek (DCPTime(), true);
374
375         /* Wait for the butler to refill */
376         dcpomatic_sleep_seconds (5);
377
378         butler->rethrow ();
379 }
380
381
382 /** Test a crash when the gap between the last audio and the start of a silent period is more than 1 sample */
383 BOOST_AUTO_TEST_CASE (player_silence_crash)
384 {
385         auto film = new_test_film2 ("player_silence_crash");
386         auto sine = content_factory("test/data/impulse_train.wav")[0];
387         film->examine_and_add_content (sine);
388         BOOST_REQUIRE (!wait_for_jobs());
389
390         sine->set_video_frame_rate(film, 23.976);
391         film->write_metadata ();
392         make_and_verify_dcp (film, {dcp::VerificationNote::Code::MISSING_CPL_METADATA});
393 }
394
395
396 /** Test a crash when processing a 3D DCP */
397 BOOST_AUTO_TEST_CASE (player_3d_test_1)
398 {
399         auto film = new_test_film2 ("player_3d_test_1a");
400         auto left = content_factory("test/data/flat_red.png")[0];
401         film->examine_and_add_content (left);
402         auto right = content_factory("test/data/flat_blue.png")[0];
403         film->examine_and_add_content (right);
404         BOOST_REQUIRE (!wait_for_jobs());
405
406         left->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
407         left->set_position (film, DCPTime());
408         right->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
409         right->set_position (film, DCPTime());
410         film->set_three_d (true);
411
412         make_and_verify_dcp (film);
413
414         auto dcp = std::make_shared<DCPContent>(film->dir(film->dcp_name()));
415         auto film2 = new_test_film2 ("player_3d_test_1b", {dcp});
416
417         film2->set_three_d (true);
418         make_and_verify_dcp (film2);
419 }
420
421
422 /** Test a crash when processing a 3D DCP as content in a 2D project */
423 BOOST_AUTO_TEST_CASE (player_3d_test_2)
424 {
425         auto left = content_factory("test/data/flat_red.png")[0];
426         auto right = content_factory("test/data/flat_blue.png")[0];
427         auto film = new_test_film2 ("player_3d_test_2a", {left, right});
428
429         left->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
430         left->set_position (film, DCPTime());
431         right->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
432         right->set_position (film, DCPTime());
433         film->set_three_d (true);
434
435         make_and_verify_dcp (film);
436
437         auto dcp = std::make_shared<DCPContent>(film->dir(film->dcp_name()));
438         auto film2 = new_test_film2 ("player_3d_test_2b", {dcp});
439
440         make_and_verify_dcp (film2);
441 }
442
443
444 /** Test a crash when there is video-only content at the end of the DCP and a frame-rate conversion is happening;
445  *  #1691.
446  */
447 BOOST_AUTO_TEST_CASE (player_silence_at_end_crash)
448 {
449         /* 25fps DCP with some audio */
450         auto content1 = content_factory("test/data/flat_red.png")[0];
451         auto film1 = new_test_film2 ("player_silence_at_end_crash_1", {content1});
452         content1->video->set_length (25);
453         film1->set_video_frame_rate (25);
454         make_and_verify_dcp (film1);
455
456         /* Make another project importing this DCP */
457         auto content2 = std::make_shared<DCPContent>(film1->dir(film1->dcp_name()));
458         auto film2 = new_test_film2 ("player_silence_at_end_crash_2", {content2});
459
460         /* and importing just the video MXF on its own at the end */
461         optional<boost::filesystem::path> video;
462         for (auto i: boost::filesystem::directory_iterator(film1->dir(film1->dcp_name()))) {
463                 if (boost::starts_with(i.path().filename().string(), "j2c_")) {
464                         video = i.path();
465                 }
466         }
467
468         BOOST_REQUIRE (video);
469         auto content3 = content_factory(*video)[0];
470         film2->examine_and_add_content (content3);
471         BOOST_REQUIRE (!wait_for_jobs());
472         content3->set_position (film2, DCPTime::from_seconds(1.5));
473         film2->set_video_frame_rate (24);
474         make_and_verify_dcp (film2);
475 }
476
477
478 /** #2257 */
479 BOOST_AUTO_TEST_CASE (encrypted_dcp_with_no_kdm_gives_no_butler_error)
480 {
481         auto content = content_factory("test/data/flat_red.png")[0];
482         auto film = new_test_film2 ("encrypted_dcp_with_no_kdm_gives_no_butler_error", { content });
483         int constexpr length = 24 * 25;
484         content->video->set_length(length);
485         film->set_encrypted (true);
486         make_and_verify_dcp (
487                 film,
488                 {
489                         dcp::VerificationNote::Code::MISSING_CPL_METADATA,
490                 });
491
492         auto content2 = std::make_shared<DCPContent>(film->dir(film->dcp_name()));
493         auto film2 = new_test_film2 ("encrypted_dcp_with_no_kdm_gives_no_butler_error2", { content2 });
494
495         Player player(film, Image::Alignment::COMPACT);
496         Butler butler(film2, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false, Butler::Audio::ENABLED);
497
498         float buffer[2000 * 6];
499         for (int i = 0; i < length; ++i) {
500                 butler.get_video(Butler::Behaviour::BLOCKING, 0);
501                 butler.get_audio(Butler::Behaviour::BLOCKING, buffer, 2000);
502         }
503
504         BOOST_CHECK_NO_THROW(butler.rethrow());
505 }
506
507
508 BOOST_AUTO_TEST_CASE (interleaved_subtitle_are_emitted_correctly)
509 {
510         boost::filesystem::path paths[2] = {
511                 "build/test/interleaved_subtitle_are_emitted_correctly1.srt",
512                 "build/test/interleaved_subtitle_are_emitted_correctly2.srt"
513         };
514
515         dcp::File subs_file[2] = { dcp::File(paths[0], "w"), dcp::File(paths[1], "w") };
516
517         fprintf(subs_file[0].get(), "1\n00:00:01,000 -> 00:00:02,000\nSub 1/1\n\n");
518         fprintf(subs_file[0].get(), "2\n00:00:05,000 -> 00:00:06,000\nSub 1/2\n\n");
519
520         fprintf(subs_file[1].get(), "1\n00:00:00,500 -> 00:00:01,500\nSub 2/1\n\n");
521         fprintf(subs_file[1].get(), "2\n00:00:02,000 -> 00:00:03,000\nSub 2/2\n\n");
522
523         subs_file[0].close();
524         subs_file[1].close();
525
526         auto subs1 = content_factory(paths[0])[0];
527         auto subs2 = content_factory(paths[1])[0];
528         auto film = new_test_film2("interleaved_subtitle_are_emitted_correctly", { subs1, subs2 });
529         film->set_sequence(false);
530         subs1->set_position(film, DCPTime());
531         subs2->set_position(film, DCPTime());
532
533         Player player(film, Image::Alignment::COMPACT);
534         dcp::Time last;
535         player.Text.connect([&last](PlayerText text, TextType, optional<DCPTextTrack>, dcpomatic::DCPTimePeriod) {
536                 for (auto sub: text.string) {
537                         BOOST_CHECK(sub.in() >= last);
538                         last = sub.in();
539                 }
540         });
541         while (!player.pass()) {}
542 }
543
544
545 BOOST_AUTO_TEST_CASE(multiple_sound_files_bug)
546 {
547         Config::instance()->set_log_types(Config::instance()->log_types() | LogEntry::TYPE_DEBUG_PLAYER);
548
549         auto A = content_factory(TestPaths::private_data() / "kook" / "1.wav").front();
550         auto B = content_factory(TestPaths::private_data() / "kook" / "2.wav").front();
551         auto C = content_factory(TestPaths::private_data() / "kook" / "3.wav").front();
552
553         auto film = new_test_film2("multiple_sound_files_bug", { A, B, C });
554         C->set_position(film, DCPTime(3840000));
555
556         make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
557
558         check_mxf_audio_file(TestPaths::private_data() / "kook" / "reference.mxf", dcp_file(film, "pcm_"));
559 }
560
561
562 BOOST_AUTO_TEST_CASE(trimmed_sound_mix_bug_13)
563 {
564         auto A = content_factory("test/data/sine_16_48_440_10.wav").front();
565         auto B = content_factory("test/data/sine_16_44.1_440_10.wav").front();
566         auto film = new_test_film2("trimmed_sound_mix_bug_13", { A, B });
567
568         A->set_position(film, DCPTime());
569         A->audio->set_gain(-12);
570         B->set_position(film, DCPTime());
571         B->audio->set_gain(-12);
572         B->set_trim_start(film, ContentTime(13));
573
574         make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
575         check_mxf_audio_file("test/data/trimmed_sound_mix_bug_13.mxf", dcp_file(film, "pcm_"));
576 }
577
578
579 BOOST_AUTO_TEST_CASE(trimmed_sound_mix_bug_13_frame_rate_change)
580 {
581         auto A = content_factory("test/data/sine_16_48_440_10.wav").front();
582         auto B = content_factory("test/data/sine_16_44.1_440_10.wav").front();
583         auto film = new_test_film2("trimmed_sound_mix_bug_13_frame_rate_change", { A, B });
584
585         A->set_position(film, DCPTime());
586         A->audio->set_gain(-12);
587         B->set_position(film, DCPTime());
588         B->audio->set_gain(-12);
589         B->set_trim_start(film, ContentTime(13));
590
591         A->set_video_frame_rate(film, 24);
592         B->set_video_frame_rate(film, 24);
593         film->set_video_frame_rate(25);
594
595         make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
596         check_mxf_audio_file("test/data/trimmed_sound_mix_bug_13_frame_rate_change.mxf", dcp_file(film, "pcm_"));
597 }
598