summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-15 22:37:47 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-15 22:37:47 +0000
commit3584157f1c3891259da0f86ea933f390449ad657 (patch)
tree4e7561be49900a5f1e26ca736e9db8b72ce5431f /src
parentba82749e36797bbf907dbe8ebfa335e02935cc52 (diff)
Give a better error when FFmpegImageProxy fails to decode an image that was passed in without a filename.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg_image_proxy.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc
index 3548117ff..33c619a2d 100644
--- a/src/lib/ffmpeg_image_proxy.cc
+++ b/src/lib/ffmpeg_image_proxy.cc
@@ -146,7 +146,12 @@ FFmpegImageProxy::image (optional<dcp::Size>) const
e = avformat_open_input (&format_context, "foo.tga", f, &options);
}
if (e < 0) {
- throw OpenFileError (_path->string(), e, true);
+ if (_path) {
+ throw OpenFileError (_path->string(), e, true);
+ } else {
+ /* XXX: this needs to be marked translatable after the string freeze is over */
+ boost::throw_exception(DecodeError(String::compose("Could not decode image (%1)", e)));
+ }
}
if (avformat_find_stream_info(format_context, 0) < 0) {