summaryrefslogtreecommitdiff
path: root/src/lib/format.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-10 19:43:01 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-10 19:43:01 +0100
commit9bdd8cc51942a13e360dde4efc04b3ca417c8b94 (patch)
tree502e33212c51fa5e269cbdec87a29ed8fa711243 /src/lib/format.cc
parent5c620f37c8979a645a2094aa36b9af3d4f4ef5ec (diff)
parent01bb4ca21bea60137dce7201d9a37a0cf5691812 (diff)
Merge master.
Diffstat (limited to 'src/lib/format.cc')
-rw-r--r--src/lib/format.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/format.cc b/src/lib/format.cc
index 5eda9eb88..cce8762bd 100644
--- a/src/lib/format.cc
+++ b/src/lib/format.cc
@@ -200,14 +200,14 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d
int
Format::dcp_padding (shared_ptr<const Film> f) const
{
- int pad = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0);
+ int p = rint ((_dcp_size.width - (_dcp_size.height * ratio(f))) / 2.0);
/* This comes out -ve for Scope; bodge it */
- if (pad < 0) {
- pad = 0;
+ if (p < 0) {
+ p = 0;
}
- return pad;
+ return p;
}
float
@@ -231,7 +231,8 @@ VariableFormat::ratio_as_integer (shared_ptr<const Film> f) const
float
VariableFormat::ratio_as_float (shared_ptr<const Film> f) const
{
- return float (f->video_size().width) / f->video_size().height;
+ libdcp::Size const c = f->cropped_size (f->video_size ());
+ return float (c.width) / c.height;
}
/** @return A name to be presented to the user */