diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-06-10 22:55:34 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-06-10 22:55:34 +0200 |
| commit | 130b03ddabdd5abd5052651aae86ad1955e39ad3 (patch) | |
| tree | f1463d2db4b2e685f4f34c609ac41eb14bea3453 /src/lib | |
| parent | 2a4d704fbd7653e9682aa1c10cbe1dfd093fe710 (diff) | |
Give more detail when an assertion trips (#2828).2828-jpeg
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ffmpeg_image_proxy.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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<dcp::Size>) 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) { |
