projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6656651
)
Ignore parameters in PKL type strings when checking them.
author
Carl Hetherington
<cth@carlh.net>
Wed, 14 Apr 2021 10:40:01 +0000
(12:40 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 14 Apr 2021 14:20:45 +0000
(16:20 +0200)
src/dcp.cc
patch
|
blob
|
history
diff --git
a/src/dcp.cc
b/src/dcp.cc
index c72bef63680f56b71f80ac4aa5cf50b79c1e0d6b..cea79ba4ee6cfb0c4152a1b5db48757349af7315 100644
(file)
--- a/
src/dcp.cc
+++ b/
src/dcp.cc
@@
-221,7
+221,16
@@
DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
continue;
}
continue;
}
- if (*pkl_type == CPL::static_pkl_type(*_standard) || *pkl_type == InteropSubtitleAsset::static_pkl_type(*_standard)) {
+ auto remove_parameters = [](string const& n) {
+ return n.substr(0, n.find(";"));
+ };
+
+ /* Remove any optional parameters (after ;) */
+ pkl_type = pkl_type->substr(0, pkl_type->find(";"));
+
+ if (
+ pkl_type == remove_parameters(CPL::static_pkl_type(*_standard)) ||
+ pkl_type == remove_parameters(InteropSubtitleAsset::static_pkl_type(*_standard))) {
auto p = new xmlpp::DomParser;
try {
p->parse_file (path.string());
auto p = new xmlpp::DomParser;
try {
p->parse_file (path.string());
@@
-246,14
+255,14
@@
DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
other_assets.push_back (make_shared<InteropSubtitleAsset>(path));
}
} else if (
other_assets.push_back (make_shared<InteropSubtitleAsset>(path));
}
} else if (
- *pkl_type ==
PictureAsset::static_pkl_type(*_standard
) ||
- *pkl_type ==
SoundAsset::static_pkl_type(*_standard
) ||
- *pkl_type ==
AtmosAsset::static_pkl_type(*_standard
) ||
- *pkl_type ==
SMPTESubtitleAsset::static_pkl_type(*_standard
)
+ *pkl_type ==
remove_parameters(PictureAsset::static_pkl_type(*_standard)
) ||
+ *pkl_type ==
remove_parameters(SoundAsset::static_pkl_type(*_standard)
) ||
+ *pkl_type ==
remove_parameters(AtmosAsset::static_pkl_type(*_standard)
) ||
+ *pkl_type ==
remove_parameters(SMPTESubtitleAsset::static_pkl_type(*_standard)
)
) {
other_assets.push_back (asset_factory(path, ignore_incorrect_picture_mxf_type));
) {
other_assets.push_back (asset_factory(path, ignore_incorrect_picture_mxf_type));
- } else if (*pkl_type ==
FontAsset::static_pkl_type(*_standard
)) {
+ } else if (*pkl_type ==
remove_parameters(FontAsset::static_pkl_type(*_standard)
)) {
other_assets.push_back (make_shared<FontAsset>(i.first, path));
} else if (*pkl_type == "image/png") {
/* It's an Interop PNG subtitle; let it go */
other_assets.push_back (make_shared<FontAsset>(i.first, path));
} else if (*pkl_type == "image/png") {
/* It's an Interop PNG subtitle; let it go */