clipboard-vo: make logging verbose when clipboard is unavailable

It now only warns when the clipboard is implemented but get/set
failed. This is consistent with other properties like current-vo.
This commit is contained in:
nanahi
2024-12-06 12:21:18 -05:00
committed by Kacper Michajłow
parent e62503cb39
commit e121c092b4

View File

@@ -45,11 +45,17 @@ static int get_data(struct clipboard_ctx *cl, struct clipboard_access_params *pa
if (!vo)
return CLIPBOARD_UNAVAILABLE;
if (vo_control(vo, VOCTRL_GET_CLIPBOARD, &vc) == VO_TRUE) {
int ret = vo_control(vo, VOCTRL_GET_CLIPBOARD, &vc);
switch (ret) {
case VO_TRUE:
*out = vc.data;
return CLIPBOARD_SUCCESS;
} else {
MP_WARN(cl, "VO is not initialized, or it does not support getting clipboard.\n");
case VO_NOTAVAIL:
case VO_NOTIMPL:
MP_VERBOSE(cl, "VO does not support getting clipboard in the requested format.\n");
return CLIPBOARD_UNAVAILABLE;
default:
MP_WARN(cl, "Failed getting VO clipboard.\n");
return CLIPBOARD_FAILED;
}
}
@@ -66,10 +72,16 @@ static int set_data(struct clipboard_ctx *cl, struct clipboard_access_params *pa
if (!vo)
return CLIPBOARD_UNAVAILABLE;
if (vo_control(vo, VOCTRL_SET_CLIPBOARD, &vc) == VO_TRUE) {
int ret = vo_control(vo, VOCTRL_SET_CLIPBOARD, &vc);
switch (ret) {
case VO_TRUE:
return CLIPBOARD_SUCCESS;
} else {
MP_WARN(cl, "VO is not initialized, or it does not support setting clipboard.\n");
case VO_NOTAVAIL:
case VO_NOTIMPL:
MP_VERBOSE(cl, "VO does not support setting clipboard in the requested format.\n");
return CLIPBOARD_UNAVAILABLE;
default:
MP_WARN(cl, "Failed setting VO clipboard.\n");
return CLIPBOARD_FAILED;
}
}