summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-29 22:56:55 +0200
committerCarl Hetherington <cth@carlh.net>2024-10-05 23:22:30 +0200
commit4ba1475736d36fe3b6b3e9ce653cde561695e7e6 (patch)
treefa58363210774d4d4fbf2f1fbfde2ae07c732bc5
parent7da1ba1be59c48af133b2fec83dc272ef21ba2db (diff)
Rename XML tags Fade{In,Out} to VideoFade{In,Out}.
-rw-r--r--src/lib/film.cc4
-rw-r--r--src/lib/video_content.cc10
m---------test/data0
-rw-r--r--test/time_calculation_test.cc8
4 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index ded96ab45..b624b234b 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -142,8 +142,10 @@ static constexpr char assets_file[] = "assets.xml";
* have had Subtitle prefixes or suffixes removed.
* 37 -> 38
* VideoContent scale expressed just as "guess" or "custom"
+ * 38 -> 39
+ * Fade{In,Out} -> VideoFade{In,Out}
*/
-int const Film::current_state_version = 38;
+int const Film::current_state_version = 39;
/** Construct a Film object in a given directory.
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 10dd5ff1e..058bb4ea2 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -175,8 +175,10 @@ VideoContent::VideoContent (Content* parent, cxml::ConstNodePtr node, int versio
_yuv = node->optional_bool_child("YUV").get_value_or (true);
- if (version >= 32) {
- /* These should be VideoFadeIn and VideoFadeOut but we'll leave them like this until 2.18.x */
+ if (version >= 39) {
+ _fade_in = node->number_child<Frame>("VideoFadeIn");
+ _fade_out = node->number_child<Frame>("VideoFadeOut");
+ } else if (version >= 32) {
_fade_in = node->number_child<Frame> ("FadeIn");
_fade_out = node->number_child<Frame> ("FadeOut");
} else {
@@ -298,8 +300,8 @@ VideoContent::as_xml(xmlpp::Element* element) const
_colour_conversion.get().as_xml(cxml::add_child(element, "ColourConversion"));
}
cxml::add_text_child(element, "YUV", _yuv ? "1" : "0");
- cxml::add_text_child(element, "FadeIn", raw_convert<string>(_fade_in));
- cxml::add_text_child(element, "FadeOut", raw_convert<string>(_fade_out));
+ cxml::add_text_child(element, "VideoFadeIn", raw_convert<string>(_fade_in));
+ cxml::add_text_child(element, "VideoFadeOut", raw_convert<string>(_fade_out));
cxml::add_text_child(element, "Range", _range == VideoRange::FULL ? "full" : "video");
_pixel_quanta.as_xml(cxml::add_child(element, "PixelQuanta"));
if (_burnt_subtitle_language) {
diff --git a/test/data b/test/data
-Subproject 6852489c035e5af96191e66dd9972e3b6307cc8
+Subproject dc18332316687dc2e4171e3b5905ea266c35763
diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc
index 28a1c61ab..6c2b92a39 100644
--- a/test/time_calculation_test.cc
+++ b/test/time_calculation_test.cc
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
doc->read_string (xml);
list<string> notes;
- auto content = std::make_shared<FFmpegContent>(doc, boost::none, film->state_version(), notes);
+ auto content = std::make_shared<FFmpegContent>(doc, boost::none, 38, notes);
/* 25fps content, 25fps DCP */
film->set_video_frame_rate (25);
@@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
doc->read_string (xml);
list<string> notes;
- auto content = std::make_shared<FFmpegContent>(doc, boost::none, film->state_version(), notes);
+ auto content = std::make_shared<FFmpegContent>(doc, boost::none, 38, notes);
film->set_sequence (false);
film->add_content (content);
@@ -398,7 +398,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
doc->read_string (xml);
list<string> notes;
- auto content = std::make_shared<FFmpegContent>(doc, boost::none, film->state_version(), notes);
+ auto content = std::make_shared<FFmpegContent>(doc, boost::none, 38, notes);
film->set_sequence (false);
film->add_content (content);
@@ -574,7 +574,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
doc->read_string (xml);
list<string> notes;
- auto content = std::make_shared<FFmpegContent>(doc, boost::none, film->state_version(), notes);
+ auto content = std::make_shared<FFmpegContent>(doc, boost::none, 38, notes);
auto stream = content->audio->streams().front();
film->set_sequence (false);
film->add_content (content);