mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user