summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg/Error.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg/Error.cxx')
-rw-r--r--src/lib/ffmpeg/Error.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ffmpeg/Error.cxx b/src/lib/ffmpeg/Error.cxx
index 92608300f..2b9cc5a6c 100644
--- a/src/lib/ffmpeg/Error.cxx
+++ b/src/lib/ffmpeg/Error.cxx
@@ -21,6 +21,7 @@
#include "Error.hxx"
#include "Domain.hxx"
#include "util/Error.hxx"
+#include "util/RuntimeError.hxx"
extern "C" {
#include <libavutil/error.h>
@@ -34,6 +35,14 @@ MakeFfmpegError(int errnum)
return std::runtime_error(msg);
}
+std::runtime_error
+MakeFfmpegError(int errnum, const char *prefix)
+{
+ char msg[256];
+ av_strerror(errnum, msg, sizeof(msg));
+ return FormatRuntimeError("%s: %s", prefix, msg);
+}
+
void
SetFfmpegError(Error &error, int errnum)
{