summaryrefslogtreecommitdiff
path: root/src/lib/video_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-12 22:54:17 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-12 22:54:17 +0100
commitfe0b4d0512d289caf3bc327a3791edcdd0fa3d0c (patch)
tree9d5b635ea2494af2dddf78efe2ba800d483c2274 /src/lib/video_content.cc
parentb6d38b0b7125811b7eb58b55adcd5b8b7aac9266 (diff)
Add default scale-to (#664).
Diffstat (limited to 'src/lib/video_content.cc')
-rw-r--r--src/lib/video_content.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 36438fc2a..8ccb921d0 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -241,10 +241,14 @@ VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d)
_sample_aspect_ratio = ar;
_yuv = yuv;
- /* Guess correct scale from size and sample aspect ratio */
- _scale = VideoContentScale (
- Ratio::nearest_from_ratio (double (_size.width) * ar.get_value_or (1) / _size.height)
- );
+ if (Config::instance()->default_scale_to ()) {
+ _scale = VideoContentScale (Config::instance()->default_scale_to ());
+ } else {
+ /* Guess correct scale from size and sample aspect ratio */
+ _scale = VideoContentScale (
+ Ratio::nearest_from_ratio (double (_size.width) * ar.get_value_or (1) / _size.height)
+ );
+ }
}
LOG_GENERAL ("Video length obtained from header as %1 frames", _length);