#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>
film->set_audio_channels (6);
film->examine_and_add_content (c);
- wait_for_jobs ();
+ BOOST_REQUIRE (!wait_for_jobs());
accumulated.reset (new AudioBuffers (film->audio_channels(), 0));
film->examine_and_add_content (contentA);
film->examine_and_add_content (contentB);
- wait_for_jobs ();
+ BOOST_REQUIRE (!wait_for_jobs());
contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
contentA->video->set_length (3);
film->make_dcp ();
- wait_for_jobs ();
+ BOOST_REQUIRE (!wait_for_jobs());
boost::filesystem::path ref;
ref = "test";
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
- shared_ptr<Butler> butler (new Butler (player, film->log(), AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ shared_ptr<Butler> butler (new Butler (player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
butler->disable_audio();
for (int i = 0; i < 10; ++i) {
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
- shared_ptr<Butler> butler (new Butler(player, film->log(), AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ shared_ptr<Butler> butler (new Butler(player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
butler->disable_audio();
butler->seek(DCPTime::from_seconds(5), true);
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 ();
+}