summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-21 16:41:56 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-21 16:41:56 +0100
commit8fe7bb870d57051d8851b9d1eaa31dfb1e74de68 (patch)
tree0220b6e0ef881e829dd641b0e41cb187c617a94d /src
parent7c8988e311db0623dcf396b86f8555a6665d9a83 (diff)
Bump current_state_version to 32 and read video lengths correctly from old files.
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc5
-rw-r--r--src/lib/video_content.cc9
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index bdd650437..50b1b4fad 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -87,8 +87,11 @@ using dcp::raw_convert;
* Subtitle offset changed to subtitle y offset, and subtitle x offset added.
* 7 -> 8
* Use <Scale> tag in <VideoContent> rather than <Ratio>.
+ *
+ * Bumped to 32 for 2.0 branch; some times are expressed in Times rather
+ * than frames now.
*/
-int const Film::current_state_version = 8;
+int const Film::current_state_version = 32;
/** Construct a Film object in a given directory.
*
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 9c8ecf0bb..58053c822 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -85,10 +85,17 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
VideoContent::VideoContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version)
: Content (f, node)
{
- _video_length = ContentTime (node->number_child<int64_t> ("VideoLength"));
_video_size.width = node->number_child<int> ("VideoWidth");
_video_size.height = node->number_child<int> ("VideoHeight");
_video_frame_rate = node->number_child<float> ("VideoFrameRate");
+
+ if (version < 32) {
+ /* DCP-o-matic 1.0 branch */
+ _video_length = ContentTime::from_frames (node->number_child<int64_t> ("VideoLength"), _video_frame_rate);
+ } else {
+ _video_length = ContentTime (node->number_child<int64_t> ("VideoLength"));
+ }
+
_video_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
_crop.left = node->number_child<int> ("LeftCrop");
_crop.right = node->number_child<int> ("RightCrop");