summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
-rw-r--r--src/lib/ffmpeg_examiner.cc7
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
{