Even better open-file error reports.
[dcpomatic.git] / src / lib / ffmpeg.cc
index 1f16514d7496b780b31d1ff5a4002d54c0f63923..4b95666b800cbf6525314b5525c4f6645bf61201 100644 (file)
@@ -131,8 +131,9 @@ FFmpeg::setup_general ()
        av_dict_set (&options, "analyzeduration", raw_convert<string> (5 * 60 * 1000000).c_str(), 0);
        av_dict_set (&options, "probesize", raw_convert<string> (5 * 60 * 1000000).c_str(), 0);
 
-       if (avformat_open_input (&_format_context, 0, 0, &options) < 0) {
-               throw OpenFileError (_ffmpeg_content->path(0).string ());
+       int e = avformat_open_input (&_format_context, 0, 0, &options);
+       if (e < 0) {
+               throw OpenFileError (_ffmpeg_content->path(0).string(), e, true);
        }
 
        if (avformat_find_stream_info (_format_context, 0) < 0) {