diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-12 22:54:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-12 22:54:17 +0100 |
| commit | fe0b4d0512d289caf3bc327a3791edcdd0fa3d0c (patch) | |
| tree | 9d5b635ea2494af2dddf78efe2ba800d483c2274 /src/lib/video_content.cc | |
| parent | b6d38b0b7125811b7eb58b55adcd5b8b7aac9266 (diff) | |
Add default scale-to (#664).
Diffstat (limited to 'src/lib/video_content.cc')
| -rw-r--r-- | src/lib/video_content.cc | 12 |
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); |
