+2018-02-08 Carl Hetherington <cth@carlh.net>
+
+ * Fix crash on adding content to a project created from a template
+ in some cases (#1192).
+
2018-02-07 Carl Hetherington <cth@carlh.net>
* Version 2.11.50 released.
}
}
+/** Take settings from the given content if it is of the correct type */
void
Content::take_settings_from (shared_ptr<const Content> c)
{
DCPContent::take_settings_from (shared_ptr<const Content> c)
{
shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (c);
- DCPOMATIC_ASSERT (dc);
+ if (!dc) {
+ return;
+ }
_reference_video = dc->_reference_video;
_reference_audio = dc->_reference_audio;
void
FFmpegContent::take_settings_from (shared_ptr<const Content> c)
{
- Content::take_settings_from (c);
-
shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (c);
+ if (!fc) {
+ return;
+ }
+
+ Content::take_settings_from (c);
_filters = fc->_filters;
}
if (_template_film) {
/* Take settings from the first piece of content of c's type in _template */
BOOST_FOREACH (shared_ptr<Content> i, _template_film->content()) {
- if (typeid(i.get()) == typeid(c.get())) {
- c->take_settings_from (i);
- }
+ c->take_settings_from (i);
}
}