Mercurial > mplayer.hg
changeset 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 |
files | gui/wm/ws.c help/help_mp-de.h help/help_mp-en.h |
diffstat | 3 files changed, 14 insertions(+), 5 deletions(-) [+] |
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; }
--- a/help/help_mp-de.h Thu Jan 10 12:23:17 2013 +0000 +++ b/help/help_mp-de.h Thu Jan 10 15:24:39 2013 +0000 @@ -1055,6 +1055,7 @@ #define MSGTR_WS_NotEnoughMemoryDrawBuffer "[ws] Sorry, nicht genügend Speicher zum Schreiben des Buffers.\n" #define MSGTR_WS_DpmsUnavailable "DPMS nicht verfügbar?\n" #define MSGTR_WS_DpmsNotEnabled "Konnte DPMS nicht aktivieren.\n" +#define MSGTR_WS_XError "[ws] Ein X11-Fehler ist aufgetreten!\n" // wsxdnd.c #define MSGTR_WS_NotAFile "Dies scheint keine Datei zu sein...\n"
--- a/help/help_mp-en.h Thu Jan 10 12:23:17 2013 +0000 +++ b/help/help_mp-en.h Thu Jan 10 15:24:39 2013 +0000 @@ -848,6 +848,7 @@ #define MSGTR_WS_NotEnoughMemoryDrawBuffer "[ws] Sorry, not enough memory to draw buffer.\n" #define MSGTR_WS_DpmsUnavailable "DPMS not available?\n" #define MSGTR_WS_DpmsNotEnabled "Could not enable DPMS.\n" +#define MSGTR_WS_XError "[ws] An X11 Error has occurred!\n" // wsxdnd.c #define MSGTR_WS_NotAFile "This does not seem to be a file...\n"