input/Plugin: migrate open() from class Error to C++ exceptions
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -20,8 +20,13 @@
|
||||
#ifndef MPD_FFMPEG_ERROR_HXX
|
||||
#define MPD_FFMPEG_ERROR_HXX
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
class Error;
|
||||
|
||||
std::runtime_error
|
||||
MakeFfmpegError(int errnum);
|
||||
|
||||
void
|
||||
SetFfmpegError(Error &error, int errnum);
|
||||
|
||||
|
Reference in New Issue
Block a user