[MPlayer-cvslog] r32802 - trunk/gui/mplayer/gui_common.c

ib subversion at mplayerhq.hu
Thu Jan 20 11:23:06 CET 2011


Author: ib
Date: Thu Jan 20 11:23:06 2011
New Revision: 32802

Log:
Translate messages shown in the GUI window(s) only from UTF-8
if they are in UTF-8, i.e. check the conversation

Modified:
   trunk/gui/mplayer/gui_common.c

Modified: trunk/gui/mplayer/gui_common.c
==============================================================================
--- trunk/gui/mplayer/gui_common.c	Thu Jan 20 10:41:43 2011	(r32801)
+++ trunk/gui/mplayer/gui_common.c	Thu Jan 20 11:23:06 2011	(r32802)
@@ -77,7 +77,7 @@ static inline void TranslateFilename( in
           else
            {
             msg = g_filename_from_utf8( MSGTR_NoFileLoaded, -1, NULL, NULL, NULL );
-            av_strlcpy( tmp, msg, tmplen );
+            av_strlcpy( tmp, ( msg ? msg : MSGTR_NoFileLoaded ), tmplen );
            }
           break;
 #ifdef CONFIG_DVDREAD
@@ -85,24 +85,24 @@ static inline void TranslateFilename( in
           if ( guiIntfStruct.DVD.current_chapter )
            {
             msg = g_filename_from_utf8( MSGTR_Chapter, -1, NULL, NULL, NULL );
-            snprintf( tmp, tmplen, msg, guiIntfStruct.DVD.current_chapter );
+            snprintf( tmp, tmplen, ( msg ? msg : MSGTR_Chapter ), guiIntfStruct.DVD.current_chapter );
            }
           else
            {
             msg = g_filename_from_utf8( MSGTR_NoChapter, -1, NULL, NULL, NULL );
-            av_strlcat( tmp, msg, tmplen );
+            av_strlcat( tmp, ( msg ? msg : MSGTR_NoChapter ), tmplen );
            }
           break;
 #endif
 #ifdef CONFIG_VCD
    case STREAMTYPE_VCD:
         msg = g_filename_from_utf8( MSGTR_VCDTrack, -1, NULL, NULL, NULL );
-        snprintf( tmp, tmplen, msg, guiIntfStruct.Track );
+        snprintf( tmp, tmplen, ( msg ? msg : MSGTR_VCDTrack ), guiIntfStruct.Track );
 	break;
 #endif
    default:
      msg = g_filename_from_utf8( MSGTR_NoMediaOpened, -1, NULL, NULL, NULL );
-     av_strlcpy( tmp, msg, tmplen );
+     av_strlcpy( tmp, ( msg ? msg : MSGTR_NoMediaOpened ), tmplen );
   }
  g_free(msg);
  if ( c )


More information about the MPlayer-cvslog mailing list