[MPlayer-cvslog] r31691 - trunk/mp_msg.c

reimar subversion at mplayerhq.hu
Sun Jul 11 10:02:26 CEST 2010


Author: reimar
Date: Sun Jul 11 10:02:26 2010
New Revision: 31691

Log:
Avoid status line being mangled together with error messages and other
output.
Patch by Dan Oscarsson [Dan.Oscarsson tieto com]

Modified:
   trunk/mp_msg.c

Modified: trunk/mp_msg.c
==============================================================================
--- trunk/mp_msg.c	Sun Jul 11 09:37:02 2010	(r31690)
+++ trunk/mp_msg.c	Sun Jul 11 10:02:26 2010	(r31691)
@@ -181,6 +181,8 @@ void mp_msg(int mod, int lev, const char
     char tmp[MSGSIZE_MAX];
     FILE *stream = lev <= MSGL_WARN ? stderr : stdout;
     static int header = 1;
+    // indicates if last line printed was a status line
+    static int statusline;
     size_t len;
 
     if (!mp_msg_test(mod, lev)) return; // do not display
@@ -221,6 +223,11 @@ void mp_msg(int mod, int lev, const char
     }
 #endif
 
+    // as a status line normally is intended to be overwitten by next status line
+    // output a '\n' to get a normal message on a separate line
+    if (statusline && lev != MSGL_STATUS) fprintf(stream, "\n");
+    statusline = lev == MSGL_STATUS;
+
     if (header)
         print_msg_module(stream, mod);
     set_msg_color(stream, lev);


More information about the MPlayer-cvslog mailing list