diff options
Diffstat (limited to 'src/input/MmsInputPlugin.cxx')
-rw-r--r-- | src/input/MmsInputPlugin.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/input/MmsInputPlugin.cxx b/src/input/MmsInputPlugin.cxx index 80d479613..02810bb22 100644 --- a/src/input/MmsInputPlugin.cxx +++ b/src/input/MmsInputPlugin.cxx @@ -22,6 +22,8 @@ #include "InputInternal.hxx" #include "InputStream.hxx" #include "InputPlugin.hxx" +#include "util/Error.hxx" +#include "util/Domain.hxx" #include <glib.h> #include <libmms/mmsx.h> @@ -56,16 +58,12 @@ struct MmsInputStream { } }; -static inline GQuark -mms_quark(void) -{ - return g_quark_from_static_string("mms"); -} +static constexpr Domain mms_domain("mms"); static struct input_stream * input_mms_open(const char *url, Mutex &mutex, Cond &cond, - GError **error_r) + Error &error) { if (!g_str_has_prefix(url, "mms://") && !g_str_has_prefix(url, "mmsh://") && @@ -75,7 +73,7 @@ input_mms_open(const char *url, const auto mms = mmsx_connect(nullptr, nullptr, url, 128 * 1024); if (mms == nullptr) { - g_set_error(error_r, mms_quark(), 0, "mmsx_connect() failed"); + error.Set(mms_domain, "mmsx_connect() failed"); return nullptr; } @@ -85,18 +83,15 @@ input_mms_open(const char *url, static size_t input_mms_read(struct input_stream *is, void *ptr, size_t size, - GError **error_r) + Error &error) { MmsInputStream *m = (MmsInputStream *)is; int ret; ret = mmsx_read(nullptr, m->mms, (char *)ptr, size); if (ret <= 0) { - if (ret < 0) { - g_set_error(error_r, mms_quark(), errno, - "mmsx_read() failed: %s", - g_strerror(errno)); - } + if (ret < 0) + error.SetErrno("mmsx_read() failed"); m->eof = true; return false; |