diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-11-11 00:04:02 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-11-11 00:04:02 +0000 |
| commit | 58f0530b1687673ea6e24a083063c3fdf2bff0b2 (patch) | |
| tree | 1f76acad0a2877e527c936f754dde16eaf2d768e /src/lib/ffmpeg_examiner.cc | |
| parent | 985a83ffbf251db481150221914ef74fbfe549b2 (diff) | |
Hand-apply 80562fe5dce5fd625da583ca6f7c2833f9db8754 from master (remove default scale and use a scale guessed from the content's size and sample aspect ratio).
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 48d85da6f..46e93b16c 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -180,6 +180,13 @@ FFmpegExaminer::video_length () const return ContentTime (max (ContentTime::Type (1), length.get ())); } +optional<float> +FFmpegExaminer::sample_aspect_ratio () const +{ + AVRational sar = av_guess_sample_aspect_ratio (_format_context, _format_context->streams[_video_stream], 0); + return float (sar.num) / sar.den; +} + string FFmpegExaminer::audio_stream_name (AVStream* s) const { |
