diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-28 10:50:08 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-01 01:31:57 +0200 |
| commit | e5ae44fe8287c6a5f91c8f9dfced7cb661f0d79b (patch) | |
| tree | 3afa2bdf2c7c6e9b471d016e4b99ae0274d92ccc /src/lib/ffmpeg.cc | |
| parent | c93d0271dad86dccdbe518dbbe6e2175adce6804 (diff) | |
Tidy up some error handling a little.
Diffstat (limited to 'src/lib/ffmpeg.cc')
| -rw-r--r-- | src/lib/ffmpeg.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 7bb17f9bf..3de5da275 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -192,7 +192,7 @@ FFmpeg::setup_general () _frame = av_frame_alloc (); if (_frame == 0) { - throw DecodeError (N_("could not allocate frame")); + throw std::bad_alloc (); } } @@ -225,8 +225,9 @@ DCPOMATIC_DISABLE_WARNINGS /* Enable following of links in files */ av_dict_set_int (&options, "enable_drefs", 1, 0); - if (avcodec_open2 (context, codec, &options) < 0) { - throw DecodeError (N_("could not open decoder")); + int r = avcodec_open2 (context, codec, &options); + if (r < 0) { + throw DecodeError (N_("avcodec_open2"), N_("FFmpeg::setup_decoders"), r); } } else { dcpomatic_log->log (String::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING); |
