[Mplayer-dev-eng] Setting 'sub_unicode' automatically

Sunjin Yang lethean at realtime.ssu.ac.kr
Wed May 9 06:20:46 CEST 2001


I think that current CVS version uses 'sub_unicode' variable to distinguish
single & two-byte characters. So, for mplayer to be more smarter program, I
just add a few lines to the source to detect automatically(?) like below.

Could you apply my code to mplayer ?


--- mplayer.c   Wed May  9 13:08:08 2001
+++ mplayer.c.new     Wed May  9 13:07:58 2001
@@ -6,6 +6,7 @@
 #define RESET_AUDIO(audio_fd) ioctl(audio_fd, SNDCTL_DSP_RESET, NULL)
 //#define RESET_AUDIO(audio_fd)

+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -507,6 +508,10 @@
 #endif

   printf("%s",banner_text);
+
+  // Set locale then check whether using unicode by char length.
+  setlocale(LC_ALL, "");
+  sub_unicode = MB_CUR_MAX < 2 ? 0 : 1;

 #ifdef HAVE_GUI
   if ( nogui )

-- 

Make your life extraordinary & Carpediem... :)

Sunjin Yang
lethean at realtime.ssu.ac.kr
http://realtime.ssu.ac.kr/~lethean/
icq#:38671355


_______________________________________________
Mplayer-dev-eng mailing list
Mplayer-dev-eng at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list