diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-25 09:46:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-04-25 09:46:42 +0100 |
| commit | 055531be9496a212c86686936198cd1cf10b619d (patch) | |
| tree | 2582a6814e7ce398a7fbdb675b547949f03c3437 /src/lib | |
| parent | 891c8590484290fb103f23eee51eb194dddcc2a2 (diff) | |
Save subtitle video frame rates properly; don't cast them to int for TextSubtitleContent.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/text_subtitle_content.cc | 7 | ||||
| -rw-r--r-- | src/lib/text_subtitle_content.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc index 2044c3a41..0de219574 100644 --- a/src/lib/text_subtitle_content.cc +++ b/src/lib/text_subtitle_content.cc @@ -52,7 +52,7 @@ TextSubtitleContent::TextSubtitleContent (shared_ptr<const Film> film, cxml::Con : Content (film, node) , SubtitleContent (film, node, version) , _length (node->number_child<ContentTime::Type> ("Length")) - , _frame_rate (node->optional_number_child<double>("SubtitleFrameRate")) + , _frame_rate (node->optional_number_child<double>("SubtitleVideoFrameRate")) , _colour ( node->optional_number_child<int>("Red").get_value_or(255), node->optional_number_child<int>("Green").get_value_or(255), @@ -101,6 +101,9 @@ TextSubtitleContent::as_xml (xmlpp::Node* node) const Content::as_xml (node); SubtitleContent::as_xml (node); node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ())); + if (_frame_rate) { + node->add_child("SubtitleVideoFrameRate")->add_child_text (raw_convert<string> (_frame_rate.get())); + } node->add_child("Red")->add_child_text (raw_convert<string> (_colour.r)); node->add_child("Green")->add_child_text (raw_convert<string> (_colour.g)); node->add_child("Blue")->add_child_text (raw_convert<string> (_colour.b)); @@ -118,7 +121,7 @@ TextSubtitleContent::full_length () const } void -TextSubtitleContent::set_subtitle_video_frame_rate (int r) +TextSubtitleContent::set_subtitle_video_frame_rate (double r) { { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/text_subtitle_content.h b/src/lib/text_subtitle_content.h index ad63a0e7d..2c8e3b1b7 100644 --- a/src/lib/text_subtitle_content.h +++ b/src/lib/text_subtitle_content.h @@ -58,7 +58,7 @@ public: } double subtitle_video_frame_rate () const; - void set_subtitle_video_frame_rate (int r); + void set_subtitle_video_frame_rate (double r); void set_colour (dcp::Colour); |
