[MPlayer-cvslog] r38298 - in trunk/gui/ui: main.c menu.c playbar.c

ib subversion at mplayerhq.hu
Mon Mar 1 16:14:27 EET 2021


Author: ib
Date: Mon Mar  1 16:14:27 2021
New Revision: 38298

Log:
Don't consider MSGTR_GUI_MSG_MemoryErrorWindow to be a text constant.

Add it to a predefined buffer.

Modified:
   trunk/gui/ui/main.c
   trunk/gui/ui/menu.c
   trunk/gui/ui/playbar.c

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Mon Mar  1 16:13:24 2021	(r38297)
+++ trunk/gui/ui/main.c	Mon Mar  1 16:14:27 2021	(r38298)
@@ -52,6 +52,7 @@
 #include "codec-cfg.h"
 #include "m_option.h"
 #include "mp_core.h"
+#include "libavutil/avstring.h"
 #include "libavutil/common.h"
 
 #include "actions.h"
@@ -393,7 +394,10 @@ void uiMainInit (void)
 
   if (!mainDrawBuffer)
   {
-    gmp_msg(MSGT_GPLAYER, MSGL_FATAL, "[main] " MSGTR_GUI_MSG_MemoryErrorWindow);
+    char msg[80] = "[main] ";
+
+    av_strlcat(msg, MSGTR_GUI_MSG_MemoryErrorWindow, sizeof(msg));
+    gmp_msg(MSGT_GPLAYER, MSGL_FATAL, msg);
     mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
   }
 

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Mon Mar  1 16:13:24 2021	(r38297)
+++ trunk/gui/ui/menu.c	Mon Mar  1 16:14:27 2021	(r38298)
@@ -35,6 +35,8 @@
 
 #include "gui/dialog/dialog.h"
 
+#include "libavutil/avstring.h"
+
 unsigned char * menuDrawBuffer = NULL;
 static int      uiMenuRender = True;
 int             menuItem = -1;
@@ -109,7 +111,10 @@ void uiMenuInit( void )
 
  if ( ( menuDrawBuffer = calloc( 1,guiApp.menu.Bitmap.ImageSize ) ) == NULL )
   {
-   gmp_msg( MSGT_GPLAYER,MSGL_FATAL,"[menu] " MSGTR_GUI_MSG_MemoryErrorWindow );
+   char msg[80] = "[menu] ";
+
+   av_strlcat( msg, MSGTR_GUI_MSG_MemoryErrorWindow, sizeof(msg) );
+   gmp_msg( MSGT_GPLAYER, MSGL_FATAL, msg );
    mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 );
   }
 

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Mon Mar  1 16:13:24 2021	(r38297)
+++ trunk/gui/ui/playbar.c	Mon Mar  1 16:14:27 2021	(r38298)
@@ -47,6 +47,7 @@
 #include "libmpdemux/demuxer.h"
 #include "libmpdemux/stheader.h"
 #include "codec-cfg.h"
+#include "libavutil/avstring.h"
 
 #include "ui.h"
 #include "actions.h"
@@ -286,7 +287,10 @@ void uiPlaybarInit( void )
 
  if ( ( playbarDrawBuffer = malloc( guiApp.playbar.Bitmap.ImageSize ) ) == NULL )
   {
-   gmp_msg( MSGT_GPLAYER,MSGL_FATAL,"[playbar] " MSGTR_GUI_MSG_MemoryErrorWindow );
+   char msg[80] = "[playbar] ";
+
+   av_strlcat( msg, MSGTR_GUI_MSG_MemoryErrorWindow, sizeof(msg) );
+   gmp_msg( MSGT_GPLAYER, MSGL_FATAL, msg );
    mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 );
   }
 


More information about the MPlayer-cvslog mailing list