diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-12 22:00:33 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-12 22:00:33 +0000 |
| commit | 2913a26dd799a6cda6f1b94415167362106318dc (patch) | |
| tree | 3ed99e4ba8709c6ddbf0d3c7de1517d25c3cc7ec | |
| parent | 52f6790026040e17237ba8d7865cda3e0e239b62 (diff) | |
Ignore audio streams with no codec, instead of crashing.v2.14.52
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 3 |
1 files changed, 1 insertions, 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<const FFmpegContent> c, shared_ptr<Jo for (uint32_t i = 0; i < _format_context->nb_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<const FFmpegContent> c, shared_ptr<Jo } DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE); - DCPOMATIC_ASSERT (s->codec->codec); DCPOMATIC_ASSERT (s->codec->codec->name); _audio_streams.push_back ( |
