summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-10 21:47:11 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-10 21:47:11 +0000
commit70684e31a96bd7d4c7b09d525902959345b76526 (patch)
tree2d9f17c88d73df8c72747086e2f11b740f010395 /test
parentd9c2cf78e6c5e465e7f76020f78f7ed1e71c3bc0 (diff)
Fix a crash due the assertion in emit_audio failing when applying
trims which do not land precisely on a DCP audio sample boundary (at least, I think that's what triggers it).
Diffstat (limited to 'test')
-rw-r--r--test/player_test.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/player_test.cc b/test/player_test.cc
index 7e2631cc9..9d6641cb2 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -37,6 +37,7 @@
#include "lib/text_content.h"
#include "lib/butler.h"
#include "lib/compose.hpp"
+#include "lib/cross.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <iostream>
@@ -317,3 +318,28 @@ BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
BOOST_CHECK_EQUAL (out.size(), 6);
}
+
+/** Trigger a crash due to the assertion failure in Player::emit_audio */
+BOOST_AUTO_TEST_CASE (player_trim_crash)
+{
+ shared_ptr<Film> film = new_test_film2 ("player_trim_crash");
+ shared_ptr<Content> boon = content_factory(private_data / "boon_telly.mkv").front();
+ film->examine_and_add_content (boon);
+ BOOST_REQUIRE (!wait_for_jobs());
+
+ shared_ptr<Player> player (new Player(film, film->playlist()));
+ player->set_fast ();
+ shared_ptr<Butler> butler (new Butler(player, AudioMapping(), 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+
+ /* Wait for the butler to fill */
+ dcpomatic_sleep (5);
+
+ boon->set_trim_start (ContentTime::from_seconds(5));
+
+ butler->seek (DCPTime(), true);
+
+ /* Wait for the butler to refill */
+ dcpomatic_sleep (5);
+
+ butler->rethrow ();
+}