From 2913a26dd799a6cda6f1b94415167362106318dc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 12 May 2021 22:00:33 +0000 Subject: [PATCH] Ignore audio streams with no codec, instead of crashing. --- src/lib/ffmpeg_examiner.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 ( -- 2.30.2