X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_examiner.cc;h=673de3a1d771f2e14099d315496950cf26c7c283;hb=53d0a9a844841fe10b2720543c032a687c548108;hp=fdcacb465602693fba0bf668cc82d7bd9b82ddd6;hpb=3c29aa6531a4046a8db72dcac81189eb8893233c;p=dcpomatic.git diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index fdcacb465..673de3a1d 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -73,14 +73,6 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrcodec : nullptr; if (s->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && codec) { - /* This is a hack; sometimes it seems that _audio_codec_context->channel_layout isn't set up, - so bodge it here. No idea why we should have to do this. - */ - - if (s->codecpar->channel_layout == 0) { - s->codecpar->channel_layout = av_get_default_channel_layout (s->codecpar->channels); - } - DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE); DCPOMATIC_ASSERT (codec->name); @@ -91,7 +83,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrid, s->codecpar->sample_rate, llrint ((double(_format_context->duration) / AV_TIME_BASE) * s->codecpar->sample_rate), - s->codecpar->channels + s->codecpar->ch_layout.nb_channels ) ); @@ -160,7 +152,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptr= (PULLDOWN_CHECK_FRAMES * 2)) { + if (got_all_audio && (!_video_stream || (_first_video && temporal_reference.size() >= (PULLDOWN_CHECK_FRAMES * 2)))) { /* All done */ break; }