kutils: warn when the media player option type is invalid

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-09-23 08:03:09 +03:00
parent c9a0aaf40b
commit 1a06d034e0

View file

@ -140,7 +140,7 @@ static QVariant mpvNodeToVariant(const mpv_node *mpvnode)
#define COMMON_OPTION_SETTER \
kDebug() << i18n("setting option") << name << value; \
if (d->m_handle) { \
int mpvresult = MPV_ERROR_PROPERTY_FORMAT; \
int mpvresult = 0; \
switch (value.type()) { \
case QVariant::Bool: { \
int boolvalue = value.toBool(); \
@ -168,6 +168,10 @@ static QVariant mpvNodeToVariant(const mpv_node *mpvnode)
mpvresult = mpv_set_property(d->m_handle, name.constData(), MPV_FORMAT_STRING, &bytevaluedata); \
break; \
} \
default: { \
kWarning() << i18n("Invalid option type") << value.type(); \
break; \
} \
} \
if (mpvresult < 0) { \
kWarning() << name << mpv_error_string(mpvresult); \
@ -180,7 +184,6 @@ static QVariant mpvNodeToVariant(const mpv_node *mpvnode)
switch (event->event_id) { \
case MPV_EVENT_NONE: { \
return; \
break; \
} \
case MPV_EVENT_SHUTDOWN: { \
d->m_stopprocessing = true; \