summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-19 22:54:19 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-19 22:54:19 +0200
commit6f832724ef942f133f6f8d0a06d7377beea8f7a6 (patch)
tree93c07267f75597bcbb2bab144c4a2b43a9ce94db /src/lib/ffmpeg_examiner.cc
parent3b28f6ad6e4ebdbab8928079b63f962844060c2b (diff)
Don't assert on a non-existant codec (#1999).
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
-rw-r--r--src/lib/ffmpeg_examiner.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 632508e0e..a793c7b98 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -69,7 +69,8 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
auto s = _format_context->streams[i];
- if (s->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+ auto codec = _codec_context[i]->codec;
+ 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.
@@ -79,10 +80,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
s->codecpar->channel_layout = av_get_default_channel_layout (s->codecpar->channels);
}
- auto codec = _codec_context[i]->codec;
-
DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE);
- DCPOMATIC_ASSERT (codec);
DCPOMATIC_ASSERT (codec->name);
_audio_streams.push_back (