X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fformat.cc;h=5eda9eb889ef1896b9a86613259b12424a58c49f;hb=e94cd129dcd66a76210880bfdf19d27f7992651b;hp=0ca97303e7b28fe91ddaec6abae726232330de8a;hpb=546c1c3a19d79968b414fb61a9ab10989d942ae1;p=dcpomatic.git diff --git a/src/lib/format.cc b/src/lib/format.cc index 0ca97303e..5eda9eb88 100644 --- a/src/lib/format.cc +++ b/src/lib/format.cc @@ -29,6 +29,7 @@ #include #include "format.h" #include "film.h" +#include "playlist.h" #include "i18n.h" @@ -199,14 +200,14 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d int Format::dcp_padding (shared_ptr f) const { - int p = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0); + int pad = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0); /* This comes out -ve for Scope; bodge it */ - if (p < 0) { - p = 0; + if (pad < 0) { + pad = 0; } - return p; + return pad; } float @@ -230,7 +231,7 @@ VariableFormat::ratio_as_integer (shared_ptr f) const float VariableFormat::ratio_as_float (shared_ptr f) const { - return float (f->size().width) / f->size().height; + return float (f->video_size().width) / f->video_size().height; } /** @return A name to be presented to the user */