X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fvideo_content.cc;h=1c0bc5a60d045f758a17cf1948decf3dc1aa71c5;hp=e2fba5829a6f489e6638b94d376f624371dc4f1e;hb=4a4725e41bf4070969223f9c40885063c50e61d0;hpb=6300edd66433dffed9fb30a0b3b8db7ca3355809 diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index e2fba5829..1c0bc5a60 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -103,10 +103,10 @@ VideoContent::VideoContent (shared_ptr film, cxml::ConstNodePtr node { _video_size.width = node->number_child ("VideoWidth"); _video_size.height = node->number_child ("VideoHeight"); - _video_frame_rate = node->number_child ("VideoFrameRate"); + _video_frame_rate = node->number_child ("VideoFrameRate"); _video_length = node->number_child ("VideoLength"); _video_frame_type = static_cast (node->number_child ("VideoFrameType")); - _sample_aspect_ratio = node->optional_number_child ("SampleAspectRatio"); + _sample_aspect_ratio = node->optional_number_child ("SampleAspectRatio"); _crop.left = node->number_child ("LeftCrop"); _crop.right = node->number_child ("RightCrop"); _crop.top = node->number_child ("TopCrop"); @@ -218,9 +218,9 @@ VideoContent::take_from_video_examiner (shared_ptr d) { /* These examiner calls could call other content methods which take a lock on the mutex */ dcp::Size const vs = d->video_size (); - optional const vfr = d->video_frame_rate (); + optional const vfr = d->video_frame_rate (); Frame vl = d->video_length (); - optional const ar = d->sample_aspect_ratio (); + optional const ar = d->sample_aspect_ratio (); { boost::mutex::scoped_lock lm (_mutex); @@ -232,7 +232,7 @@ VideoContent::take_from_video_examiner (shared_ptr d) /* Guess correct scale from size and sample aspect ratio */ _scale = VideoContentScale ( - Ratio::nearest_from_ratio (float (_video_size.width) * ar.get_value_or (1) / _video_size.height) + Ratio::nearest_from_ratio (double (_video_size.width) * ar.get_value_or (1) / _video_size.height) ); } @@ -473,7 +473,7 @@ VideoContent::scale_and_crop_to_fit_height () } void -VideoContent::set_video_frame_rate (float r) +VideoContent::set_video_frame_rate (double r) { { boost::mutex::scoped_lock lm (_mutex); @@ -487,21 +487,21 @@ VideoContent::set_video_frame_rate (float r) signal_changed (VideoContentProperty::VIDEO_FRAME_RATE); } -optional +optional VideoContent::fade (Frame f) const { DCPOMATIC_ASSERT (f >= 0); if (f < fade_in()) { - return float (f) / fade_in(); + return double (f) / fade_in(); } Frame fade_out_start = video_length() - fade_out(); if (f >= fade_out_start) { - return 1 - float (f - fade_out_start) / fade_out(); + return 1 - double (f - fade_out_start) / fade_out(); } - return optional (); + return optional (); } string @@ -518,7 +518,7 @@ VideoContent::processing_description () const ); - float ratio = video_size_after_3d_split().ratio (); + double ratio = video_size_after_3d_split().ratio (); if (sample_aspect_ratio ()) { d << ", " << _("pixel aspect ratio") << " " << fixed << setprecision(2) << sample_aspect_ratio().get () << ":1";