diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-30 13:16:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-30 13:16:52 +0000 |
| commit | 0fa016885370f0cf5b240deb48766894d8404e83 (patch) | |
| tree | cd249fe152d3fd3dde57900136d00bc80b30139b /src/lib/player.cc | |
| parent | 637a2a90d3e11306959a989ff511e0af103b2ad0 (diff) | |
Make it possible to do more stuff when there is missing DCP content in a project.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index b8eadf793..3ae95cf52 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -74,6 +74,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; +using boost::scoped_ptr; Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist) : _film (film) @@ -752,9 +753,16 @@ Player::get_reel_assets () if (!j) { continue; } - DCPDecoder decoder (j, false); + + scoped_ptr<DCPDecoder> decoder; + try { + decoder.reset (new DCPDecoder (j, false)); + } catch (...) { + return a; + } + int64_t offset = 0; - BOOST_FOREACH (shared_ptr<dcp::Reel> k, decoder.reels()) { + BOOST_FOREACH (shared_ptr<dcp::Reel> k, decoder->reels()) { DCPTime const from = i->position() + DCPTime::from_frames (offset, _film->video_frame_rate()); if (j->reference_video ()) { a.push_back ( |
