diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-11-19 14:31:25 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-11-19 14:31:25 +0000 |
| commit | 475d5986b7ba3796eb0aa93ec0b536f45e15b0a5 (patch) | |
| tree | 907e0eb423347a6dda35fbbe50f4199488a4a00e /src | |
| parent | c3d85016ac7c41925965513613b5049c1ee9237e (diff) | |
Fix bad default scale when sample aspect ratio is given as 0.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 46e93b16c..5ca05dd55 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -184,6 +184,10 @@ optional<float> 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<float> (); + } return float (sar.num) / sar.den; } |
