Make sure we have a subtitle if we're trying to reference it.
[dcpomatic.git] / src / lib / video_content_scale.cc
index 59ff4bd9b663d5fe0084192102668239ca7fc6b6..775b3d9b71ac496194318af2198717e51f0bafae 100644 (file)
@@ -25,6 +25,7 @@
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/optional.hpp>
+#include <iostream>
 
 #include "i18n.h"
 
@@ -84,13 +85,13 @@ string
 VideoContentScale::id () const
 {
        SafeStringStream s;
-       
+
        if (_ratio) {
                s << _ratio->id ();
        } else {
                s << (_scale ? "S1" : "S0");
        }
-       
+
        return s.str ();
 }
 
@@ -122,7 +123,7 @@ VideoContentScale::from_id (string id)
 
        return VideoContentScale (true);
 }
-               
+
 /** @param display_container Size of the container that we are displaying this content in.
  *  @param film_container The size of the film's image.
  */
@@ -154,9 +155,9 @@ VideoContentScale::size (shared_ptr<const VideoContent> c, dcp::Size display_con
                        float (display_container.width) / film_container.width,
                        float (display_container.height) / film_container.height
                        );
-               
-               size.width = rint (size.width * scale);
-               size.height = rint (size.height * scale);
+
+               size.width = lrintf (size.width * scale);
+               size.height = lrintf (size.height * scale);
        }
 
        return size;