summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-26 00:25:00 +0100
committerCarl Hetherington <cth@carlh.net>2018-10-26 00:25:00 +0100
commitee2cf80b14e8e78eb46280ba30cdb2f0c10c90a0 (patch)
tree24b18a6cce10daf260bb0e075257359b48b25dc1 /src/tools
parentfad8d13cd779a6237feed2c855a46e1a7c66e0ad (diff)
Basics of MP4 support in the player.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_player.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 860181477..844d92bc8 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -444,11 +444,8 @@ public:
_film->set_container (Ratio::from_id("185"));
BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
- /* This DCP has been examined and loaded */
-
shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);
- DCPOMATIC_ASSERT (dcp);
- if (dcp->needs_kdm()) {
+ if (dcp && dcp->needs_kdm()) {
optional<dcp::EncryptedKDM> kdm;
#ifdef DCPOMATIC_VARIANT_SWAROOP
kdm = get_kdm_from_url (dcp);
@@ -463,12 +460,12 @@ public:
}
}
- BOOST_FOREACH (shared_ptr<TextContent> j, dcp->text) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
j->set_use (true);
}
- if (dcp->video) {
- Ratio const * r = Ratio::nearest_from_ratio(dcp->video->size().ratio());
+ if (i->video) {
+ Ratio const * r = Ratio::nearest_from_ratio(i->video->size().ratio());
if (r->id() == "239") {
/* Any scope content means we use scope */
_film->set_container(r);
@@ -476,7 +473,7 @@ public:
}
/* Any 3D content means we use 3D mode */
- if (dcp->three_d()) {
+ if (i->video && i->video->frame_type() != VIDEO_FRAME_TYPE_2D) {
_film->set_three_d (true);
}
}
@@ -494,16 +491,17 @@ public:
if (_film->content().size() == 1) {
/* Offer a CPL menu */
shared_ptr<DCPContent> first = dynamic_pointer_cast<DCPContent>(_film->content().front());
- DCPOMATIC_ASSERT (first);
- DCPExaminer ex (first);
- int id = ID_view_cpl;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
- wxMenuItem* j = _cpl_menu->AppendRadioItem(
- id,
- wxString::Format("%s (%s)", std_to_wx(i->annotation_text()).data(), std_to_wx(i->id()).data())
- );
- j->Check(!first->cpl() || i->id() == *first->cpl());
- ++id;
+ if (first) {
+ DCPExaminer ex (first);
+ int id = ID_view_cpl;
+ BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+ wxMenuItem* j = _cpl_menu->AppendRadioItem(
+ id,
+ wxString::Format("%s (%s)", std_to_wx(i->annotation_text()).data(), std_to_wx(i->id()).data())
+ );
+ j->Check(!first->cpl() || i->id() == *first->cpl());
+ ++id;
+ }
}
}
}