- ContentTime const length = ContentTime::from_seconds (double (_format_context->duration) / AV_TIME_BASE);
- return ContentTime (max (ContentTime::Type (1), length.get ()));
+ return max (Frame (1), _video_length);
+}
+
+optional<double>
+FFmpegExaminer::sample_aspect_ratio () const
+{
+ AVRational sar = av_guess_sample_aspect_ratio (_format_context, _format_context->streams[_video_stream], 0);
+ if (sar.num == 0) {
+ /* I assume this means that we don't know */
+ return optional<double> ();
+ }
+ return double (sar.num) / sar.den;