Improve error messages when failing to decode video.
authorCarl Hetherington <cth@carlh.net>
Wed, 23 Jun 2021 14:45:32 +0000 (16:45 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 23 Jun 2021 14:45:32 +0000 (16:45 +0200)
src/lib/ffmpeg_image_proxy.cc

index 9c91d1d87d7d6c60eb883ee346acbb14876bf5ee..5214847a99bd57ca30aa277e5063244a6118c474 100644 (file)
@@ -175,12 +175,12 @@ FFmpegImageProxy::image (optional<dcp::Size>) const
        AVPacket packet;
        int r = av_read_frame (format_context, &packet);
        if (r < 0) {
-               throw DecodeError (N_("could not read frame"));
+               throw DecodeError (String::compose(N_("could not read frame in file %1"), _path->string()));
        }
 
        int frame_finished;
        if (avcodec_decode_video2(codec_context, frame, &frame_finished, &packet) < 0 || !frame_finished) {
-               throw DecodeError (N_("could not decode video"));
+               throw DecodeError (String::compose(N_("could not decode video in file %1"), _path->string()));
        }
 
        _image.reset (new Image (frame));