diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-10-22 09:29:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-10-22 09:29:38 +0100 |
| commit | 176e5b4c4dd7d2a3ff3e106c50157543f646dda6 (patch) | |
| tree | f50f7380b85ee9a3f3cc342f082fd7675825f0b2 /src | |
| parent | f8607d7950013d26b33be022bd4d06acb5807cd0 (diff) | |
Ignore video streams with zero avg_frame_rate in their AVStream (e.g. from iTunes).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ffmpeg.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index ebe62b51f..53eed97e2 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -109,7 +109,10 @@ FFmpeg::setup_general () for (uint32_t i = 0; i < _format_context->nb_streams; ++i) { AVStream* s = _format_context->streams[i]; - if (s->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + /* Files from iTunes sometimes have two video streams, one with the avg_frame_rate.num and .den set + to zero. Ignore these streams. + */ + if (s->codec->codec_type == AVMEDIA_TYPE_VIDEO && s->avg_frame_rate.num > 0 && s->avg_frame_rate.den > 0) { _video_stream = i; } } |
