Better errors on open fails; remove unused exception.
[dcpomatic.git] / src / lib / ffmpeg.cc
index 1f16514d7496b780b31d1ff5a4002d54c0f63923..f750cfd58118f37819bf6ed23ff5ad687b2ef4fd 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);
        }
 
        if (avformat_find_stream_info (_format_context, 0) < 0) {