From: Carl Hetherington Date: Wed, 12 May 2021 22:00:33 +0000 (+0000) Subject: Ignore audio streams with no codec, instead of crashing. X-Git-Tag: v2.14.52 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=2913a26dd799a6cda6f1b94415167362106318dc;p=dcpomatic.git Ignore audio streams with no codec, instead of crashing. --- diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index c57845779..32b60e0cb 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -62,7 +62,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrnb_streams; ++i) { AVStream* s = _format_context->streams[i]; - if (s->codec->codec_type == AVMEDIA_TYPE_AUDIO) { + if (s->codec->codec_type == AVMEDIA_TYPE_AUDIO && s->codec->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. @@ -73,7 +73,6 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrduration != AV_NOPTS_VALUE); - DCPOMATIC_ASSERT (s->codec->codec); DCPOMATIC_ASSERT (s->codec->codec->name); _audio_streams.push_back (