summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg/Error.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-09 15:37:06 +0200
committerMax Kellermann <max@musicpd.org>2016-09-09 18:15:01 +0200
commitfc7d3f64c007672e4c01172ccb1c46d083a8abd5 (patch)
tree3c72f16ee6cc919a17558678a1e270568182b8af /src/lib/ffmpeg/Error.cxx
parent63ab7767a37a99b5651f32e067aeb5fcbb7bd033 (diff)
input/Plugin: migrate open() from class Error to C++ exceptions
Diffstat (limited to 'src/lib/ffmpeg/Error.cxx')
-rw-r--r--src/lib/ffmpeg/Error.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/ffmpeg/Error.cxx b/src/lib/ffmpeg/Error.cxx
index 9dc193bfa..92608300f 100644
--- a/src/lib/ffmpeg/Error.cxx
+++ b/src/lib/ffmpeg/Error.cxx
@@ -26,6 +26,14 @@ extern "C" {
#include <libavutil/error.h>
}
+std::runtime_error
+MakeFfmpegError(int errnum)
+{
+ char msg[256];
+ av_strerror(errnum, msg, sizeof(msg));
+ return std::runtime_error(msg);
+}
+
void
SetFfmpegError(Error &error, int errnum)
{