summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-04 00:06:54 +0000
committerCarl Hetherington <cth@carlh.net>2019-05-04 00:06:54 +0000
commitf9754756b1cda04089fa0548bcccc51b0dd23403 (patch)
tree5d2b2143494c618f74a90360144174150fd397bd
parentbb4af4ee38488120090de1879ee43a27ba2d4537 (diff)
Include video_frame_rate in TextContent identifier so that if (for
example) some SRT subs are being burnt and their video frame rate is changed we won't try to reuse the video that has been burnt with the subs at the old frame rate.
-rw-r--r--src/lib/string_text_file_content.cc8
-rw-r--r--src/lib/string_text_file_content.h1
-rw-r--r--src/lib/text_content.cc3
3 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/string_text_file_content.cc b/src/lib/string_text_file_content.cc
index b4362a7d0..b3f7f431e 100644
--- a/src/lib/string_text_file_content.cc
+++ b/src/lib/string_text_file_content.cc
@@ -100,3 +100,11 @@ StringTextFileContent::approximate_length () const
{
return DCPTime (_length, FrameRateChange());
}
+
+string
+StringTextFileContent::identifier () const
+{
+ string s = Content::identifier ();
+ s += "_" + only_text()->identifier();
+ return s;
+}
diff --git a/src/lib/string_text_file_content.h b/src/lib/string_text_file_content.h
index 936e894d8..83323172d 100644
--- a/src/lib/string_text_file_content.h
+++ b/src/lib/string_text_file_content.h
@@ -45,6 +45,7 @@ public:
void as_xml (xmlpp::Node *, bool with_paths) const;
DCPTime full_length (boost::shared_ptr<const Film> film) const;
DCPTime approximate_length () const;
+ std::string identifier () const;
private:
ContentTime _length;
diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc
index e2f5264df..772ed31f5 100644
--- a/src/lib/text_content.cc
+++ b/src/lib/text_content.cc
@@ -399,7 +399,8 @@ TextContent::identifier () const
+ "_" + raw_convert<string> (outline_width())
+ "_" + raw_convert<string> (colour().get_value_or(dcp::Colour(255, 255, 255)).to_argb_string())
+ "_" + raw_convert<string> (dcp::effect_to_string(effect().get_value_or(dcp::NONE)))
- + "_" + raw_convert<string> (effect_colour().get_value_or(dcp::Colour(0, 0, 0)).to_argb_string());
+ + "_" + raw_convert<string> (effect_colour().get_value_or(dcp::Colour(0, 0, 0)).to_argb_string())
+ + "_" + raw_convert<string> (_parent->video_frame_rate().get_value_or(0));
/* XXX: I suppose really _fonts shouldn't be in here, since not all
types of subtitle content involve fonts.