From 130b03ddabdd5abd5052651aae86ad1955e39ad3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 10 Jun 2024 22:55:34 +0200 Subject: [PATCH] Give more detail when an assertion trips (#2828). --- src/lib/ffmpeg_image_proxy.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc index 2fcd486df..00d2a6a59 100644 --- a/src/lib/ffmpeg_image_proxy.cc +++ b/src/lib/ffmpeg_image_proxy.cc @@ -171,7 +171,13 @@ FFmpegImageProxy::image (Image::Alignment alignment, optional) const throw DecodeError (N_("avcodec_find_stream_info"), name_for_errors, r, *_path); } - DCPOMATIC_ASSERT (format_context->nb_streams == 1); + if (format_context->nb_streams != 1) { + if (_path) { + throw DecodeError("FFmpegProxy::image", String::compose("stream count %1", format_context->nb_streams), *_path); + } else { + throw DecodeError("FFmpegProxy::image", String::compose("stream count %1", format_context->nb_streams)); + } + } auto frame = av_frame_alloc (); if (!frame) { -- 2.30.2