Mercurial > mplayer.hg
diff gui/wm/ws.c @ 35635:ac2a7944829c
Replace stderr output by mp_msg() error messages.
Additionally, enable translation of error text
and add doxygen comment.
author | ib |
---|---|
date | Thu, 10 Jan 2013 15:24:39 +0000 |
parents | b98a97813f10 |
children | 840e473ba4c0 |
line wrap: on
line diff
--- a/gui/wm/ws.c Thu Jan 10 12:23:17 2013 +0000 +++ b/gui/wm/ws.c Thu Jan 10 15:24:39 2013 +0000 @@ -191,17 +191,24 @@ // Init X Window System. // ---------------------------------------------------------------------------------------------- +/** + * @brief Inform about an X error that has occurred. + * + * @param display display + * @param event pointer to an X error event structure + * + * @return 0 + */ static int wsErrorHandler(Display *display, XErrorEvent *event) { char type[128]; XGetErrorText(display, event->error_code, type, sizeof(type)); - fprintf(stderr, "[ws] Error in display.\n"); - fprintf(stderr, "[ws] Error code: %d ( %s )\n", event->error_code, type); - fprintf(stderr, "[ws] Request code: %d\n", event->request_code); - fprintf(stderr, "[ws] Minor code: %d\n", event->minor_code); - fprintf(stderr, "[ws] Modules: %s\n", current_module ? current_module : "(NULL)"); + mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_WS_XError); + mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] Error code: %d - %s\n", event->error_code, type); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] Request code: %d (minor code: %d)\n", event->request_code, event->minor_code); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] MPlayer module: %s\n", current_module ? current_module : "(none)"); return 0; }