X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg.cc;h=4fe1c04484ab38527db8bf67a051904e8fb60eee;hb=f90d74f7a0382f0dc63eef81bd553d7a7b38edb2;hp=fa369dda429c9342c2b08eed7a4b74ee50a38c35;hpb=7b2054e2a73844450b5b55c5788c02af671812ce;p=dcpomatic.git diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index fa369dda4..4fe1c0448 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -106,7 +106,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; } }