Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 119983
Collapse All | Expand All

(-)configure (+17 lines)
Lines 6957-6962 Link Here
6957
fi
6962
fi
6958
# --------------- GUI specific tests end -------------------
6963
# --------------- GUI specific tests end -------------------
6959
6964
6965
if test "$_charset" = "noconv" ; then
6966
  _charset=""
6967
elif test -z "$_charset" ; then
6968
  if test "$_gtk1" = yes ; then
6969
    _charset=`cat ${_mp_help}.charset`
6970
  else
6971
    _charset=utf8
6972
  fi
6973
fi
6974
if test "$_charset" ; then
6975
  _def_charset="#define MSG_CHARSET \"$_charset\""
6976
else
6977
  _def_charset="#undef MSG_CHARSET"
6978
fi
6960
6979
6961
6980
6962
#############################################################################
6981
#############################################################################
Lines 7404-7409 Link Here
7404
/* use GNU internationalization */
7423
/* use GNU internationalization */
7405
$_def_i18n
7424
$_def_i18n
7406
7425
7426
/* name of messages charset */
7427
$_def_charset
7428
7407
/* Runtime CPU detection */
7429
/* Runtime CPU detection */
7408
$_def_runtime_cpudetection
7430
$_def_runtime_cpudetection
7409
7431
(-)mp_msg.c (+49 lines)
Lines 7-12 Link Here
7
7
8
#include "config.h"
8
#include "config.h"
9
9
10
#ifdef USE_LANGINFO
11
#include <locale.h>
12
#include <langinfo.h>
13
#endif
14
#ifdef USE_ICONV
15
#include <iconv.h>
16
#endif
17
10
#if	defined(FOR_MENCODER) || defined(CODECS2HTML)
18
#if	defined(FOR_MENCODER) || defined(CODECS2HTML)
11
#undef HAVE_NEW_GUI
19
#undef HAVE_NEW_GUI
12
#endif
20
#endif
Lines 23-28 Link Here
23
int mp_msg_levels[MSGT_MAX]; // verbose level of this module. inited to 2
31
int mp_msg_levels[MSGT_MAX]; // verbose level of this module. inited to 2
24
int mp_msg_level_all = MSGL_STATUS;
32
int mp_msg_level_all = MSGL_STATUS;
25
int verbose = 0;
33
int verbose = 0;
34
#ifdef USE_ICONV
35
char *mp_msg_charset = NULL;
36
static char *old_charset = NULL;
37
static iconv_t msgiconv;
38
#endif
26
39
27
void mp_msg_init(void){
40
void mp_msg_init(void){
28
    int i;
41
    int i;
Lines 43-48 Link Here
43
#endif
56
#endif
44
#endif
57
#endif
45
    for(i=0;i<MSGT_MAX;i++) mp_msg_levels[i] = -2;
58
    for(i=0;i<MSGT_MAX;i++) mp_msg_levels[i] = -2;
59
#ifdef USE_ICONV
60
    mp_msg_charset = getenv("MPLAYER_CHARSET");
61
#ifdef USE_LANGINFO
62
    if (!mp_msg_charset) {
63
      setlocale(LC_CTYPE, "");
64
      mp_msg_charset = nl_langinfo(CODESET);
65
      setlocale(LC_CTYPE, "C");
66
    }
67
#endif
68
#endif
46
}
69
}
47
70
48
int mp_msg_test(int mod, int lev)
71
int mp_msg_test(int mod, int lev)
Lines 66-71 Link Here
66
        guiMessageBox(lev, tmp);
89
        guiMessageBox(lev, tmp);
67
#endif
90
#endif
68
91
92
#if defined(USE_ICONV) && defined(MSG_CHARSET)
93
    if (mp_msg_charset && strcasecmp(mp_msg_charset, "noconv")) {
94
      char tmp2[MSGSIZE_MAX];
95
      size_t inlen = strlen(tmp), outlen = MSGSIZE_MAX;
96
      char *in = tmp, *out = tmp2;
97
      if (!old_charset || strcmp(old_charset, mp_msg_charset)) {
98
        if (old_charset) {
99
          free(old_charset);
100
          iconv_close(msgiconv);
101
        }
102
        msgiconv = iconv_open(mp_msg_charset, MSG_CHARSET);
103
        old_charset = strdup(mp_msg_charset);
104
      }
105
      memset(tmp2, 0, MSGSIZE_MAX);
106
      while (iconv(msgiconv, &in, &inlen, &out, &outlen) == -1) {
107
        if (!inlen || !outlen)
108
          break;
109
        *out++ = *in++;
110
        outlen--; inlen--;
111
      }
112
      strncpy(tmp, tmp2, MSGSIZE_MAX);
113
      tmp[MSGSIZE_MAX-1] = 0;
114
      tmp[MSGSIZE_MAX-2] = '\n';
115
    }
116
#endif
117
69
#ifdef MSG_USE_COLORS
118
#ifdef MSG_USE_COLORS
70
/* that's only a silly color test */
119
/* that's only a silly color test */
71
#ifdef MP_ANNOY_ME
120
#ifdef MP_ANNOY_ME
(-)cfg-common.h (+4 lines)
Lines 6-11 Link Here
6
	{"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL, 0, -10, NULL},
6
	{"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL, 0, -10, NULL},
7
	{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
7
	{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
8
	{"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
8
	{"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
9
#ifdef USE_ICONV
10
	{"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
11
#endif
9
	{"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL},
12
	{"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL},
10
#ifdef WIN32
13
#ifdef WIN32
11
	{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
14
	{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
Lines 298-303 Link Here
298
301
299
extern int quiet;
302
extern int quiet;
300
extern int verbose;
303
extern int verbose;
304
extern char *mp_msg_charset;
301
305
302
// codec/filter opts: (defined at libmpcodecs/vd.c)
306
// codec/filter opts: (defined at libmpcodecs/vd.c)
303
extern float screen_size_xy;
307
extern float screen_size_xy;
(-)Gui/mplayer/widgets.c (-1 lines)
Lines 61-67 Link Here
61
void gtkInit( void )
61
void gtkInit( void )
62
{
62
{
63
 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init GTK ...\n" );
63
 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init GTK ...\n" );
64
 gtk_set_locale();
65
 gtk_init( 0,NULL );
64
 gtk_init( 0,NULL );
66
// gdk_set_use_xshm( TRUE );
65
// gdk_set_use_xshm( TRUE );
67
66

Return to bug 119983