Mercurial > mplayer.hg
annotate mp_msg.c @ 22297:3340e52ad814
Move some related variables together & add a comment
author | uau |
---|---|
date | Thu, 22 Feb 2007 20:44:48 +0000 |
parents | b79ca70e0cad |
children | 56a0b0f8a66e |
rev | line source |
---|---|
7200 | 1 |
17108
f9a03e3c8e23
1000l, reverting 2 more unrelated changes with last commit
ods15
parents:
17106
diff
changeset
|
2 //#define MSG_USE_COLORS |
1562 | 3 |
4 #include <stdio.h> | |
5 #include <stdlib.h> | |
6 #include <stdarg.h> | |
17972 | 7 #include <string.h> |
1562 | 8 |
1925 | 9 #include "config.h" |
10 | |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
11 #ifdef USE_LANGINFO |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
12 #include <locale.h> |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
13 #include <langinfo.h> |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
14 #endif |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
15 #ifdef USE_ICONV |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
16 #include <iconv.h> |
22002
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
17 #include <errno.h> |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
18 #endif |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
19 |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
20 #if defined(FOR_MENCODER) || defined(CODECS2HTML) |
16618 | 21 #undef HAVE_NEW_GUI |
8573
b2e4f9dab7ad
codec-cfg cannot be built when the gui is enabled - it fails to link with a
jkeil
parents:
7205
diff
changeset
|
22 #endif |
b2e4f9dab7ad
codec-cfg cannot be built when the gui is enabled - it fails to link with a
jkeil
parents:
7205
diff
changeset
|
23 |
16618 | 24 #ifdef HAVE_NEW_GUI |
16374
e2e231134056
Remove many annoying GTK includes in every compile line and remove GTK
ods15
parents:
14542
diff
changeset
|
25 #include "Gui/interface.h" |
1925 | 26 extern int use_gui; |
27 #endif | |
1562 | 28 #include "mp_msg.h" |
29 | |
6306
786ab42c10be
Extend maximum mp_msg message size, some translations need it or help message will be cutted.
atmos4
parents:
6048
diff
changeset
|
30 /* maximum message length of mp_msg */ |
786ab42c10be
Extend maximum mp_msg message size, some translations need it or help message will be cutted.
atmos4
parents:
6048
diff
changeset
|
31 #define MSGSIZE_MAX 3072 |
786ab42c10be
Extend maximum mp_msg message size, some translations need it or help message will be cutted.
atmos4
parents:
6048
diff
changeset
|
32 |
17742
c95961832830
Comment fix: mp_msg_levels[] is inited to -2, not 2.
diego
parents:
17672
diff
changeset
|
33 int mp_msg_levels[MSGT_MAX]; // verbose level of this module. inited to -2 |
17120
637a2f4ff216
Some more cola for msglevel, codec-cfg can't even call mp_msg_init or it'll
ods15
parents:
17108
diff
changeset
|
34 int mp_msg_level_all = MSGL_STATUS; |
637a2f4ff216
Some more cola for msglevel, codec-cfg can't even call mp_msg_init or it'll
ods15
parents:
17108
diff
changeset
|
35 int verbose = 0; |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
36 #ifdef USE_ICONV |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
37 char *mp_msg_charset = NULL; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
38 static char *old_charset = NULL; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
39 static iconv_t msgiconv; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
40 #endif |
1562 | 41 |
22002
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
42 const char* filename_recode(const char* filename) |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
43 { |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
44 #if !defined(USE_ICONV) || !defined(MSG_CHARSET) |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
45 return filename; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
46 #else |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
47 static iconv_t inv_msgiconv = (iconv_t)(-1); |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
48 static char recoded_filename[MSGSIZE_MAX]; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
49 size_t filename_len, max_path; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
50 char* precoded; |
22006
b79ca70e0cad
Handle mp_msg_charset == NULL correctly in filename_recode.
reimar
parents:
22005
diff
changeset
|
51 if (!mp_msg_charset || |
b79ca70e0cad
Handle mp_msg_charset == NULL correctly in filename_recode.
reimar
parents:
22005
diff
changeset
|
52 !strcasecmp(mp_msg_charset, MSG_CHARSET) || |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
53 !strcasecmp(mp_msg_charset, "noconv")) |
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
54 return filename; |
22002
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
55 if (inv_msgiconv == (iconv_t)(-1)) { |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
56 inv_msgiconv = iconv_open(MSG_CHARSET, mp_msg_charset); |
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
57 if (inv_msgiconv == (iconv_t)(-1)) |
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
58 return filename; |
22002
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
59 } |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
60 filename_len = strlen(filename); |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
61 max_path = MSGSIZE_MAX - 4; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
62 precoded = recoded_filename; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
63 if (iconv(inv_msgiconv, &filename, &filename_len, |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
64 &precoded, &max_path) == (size_t)(-1) && errno == E2BIG) { |
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
65 precoded[0] = precoded[1] = precoded[2] = '.'; |
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
66 precoded += 3; |
22002
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
67 } |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
68 *precoded = '\0'; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
69 return recoded_filename; |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
70 #endif |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
71 } |
ebd2d5efb11b
filename double-conversion, especially usefull for CJK users :-)
gpoirier
parents:
21653
diff
changeset
|
72 |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17440
diff
changeset
|
73 void mp_msg_init(void){ |
17106
05af35012e4f
new -msglevel option, constrols msg level for every msg module
ods15
parents:
16618
diff
changeset
|
74 int i; |
17440
de9a36b1082c
MPLAYER_VERBOSE, new enviorment variable to control verbosity before init
ods15
parents:
17120
diff
changeset
|
75 char *env = getenv("MPLAYER_VERBOSE"); |
de9a36b1082c
MPLAYER_VERBOSE, new enviorment variable to control verbosity before init
ods15
parents:
17120
diff
changeset
|
76 if (env) |
de9a36b1082c
MPLAYER_VERBOSE, new enviorment variable to control verbosity before init
ods15
parents:
17120
diff
changeset
|
77 verbose = atoi(env); |
17106
05af35012e4f
new -msglevel option, constrols msg level for every msg module
ods15
parents:
16618
diff
changeset
|
78 for(i=0;i<MSGT_MAX;i++) mp_msg_levels[i] = -2; |
18237
4231482179b6
Get ride of the several if(identify) messy lines and rearangment of some of the output, both patches by Kiriuja mplayer-patches AT en-directo_net, his changes are barely unrelated, nevertheless Im commiting them thogeter just for the sake of my mental healt, I had both patches already applied on my local three
reynaldo
parents:
18000
diff
changeset
|
79 mp_msg_levels[MSGT_IDENTIFY] = -1; // no -identify output by default |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
80 #ifdef USE_ICONV |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
81 mp_msg_charset = getenv("MPLAYER_CHARSET"); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
82 #ifdef USE_LANGINFO |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
83 if (!mp_msg_charset) { |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
84 setlocale(LC_CTYPE, ""); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
85 mp_msg_charset = nl_langinfo(CODESET); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
86 setlocale(LC_CTYPE, "C"); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
87 } |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
88 #endif |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
89 #endif |
1562 | 90 } |
91 | |
7058
2e5c07262861
new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents:
6306
diff
changeset
|
92 int mp_msg_test(int mod, int lev) |
2e5c07262861
new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents:
6306
diff
changeset
|
93 { |
17106
05af35012e4f
new -msglevel option, constrols msg level for every msg module
ods15
parents:
16618
diff
changeset
|
94 return lev <= (mp_msg_levels[mod] == -2 ? mp_msg_level_all + verbose : mp_msg_levels[mod]); |
7058
2e5c07262861
new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents:
6306
diff
changeset
|
95 } |
2e5c07262861
new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents:
6306
diff
changeset
|
96 |
16618 | 97 void mp_msg(int mod, int lev, const char *format, ... ){ |
5102 | 98 va_list va; |
6306
786ab42c10be
Extend maximum mp_msg message size, some translations need it or help message will be cutted.
atmos4
parents:
6048
diff
changeset
|
99 char tmp[MSGSIZE_MAX]; |
5102 | 100 |
17106
05af35012e4f
new -msglevel option, constrols msg level for every msg module
ods15
parents:
16618
diff
changeset
|
101 if (!mp_msg_test(mod, lev)) return; // do not display |
5286
30caf02c0eae
10l - va_start needs teh pointer to stack - not the translated message
arpi
parents:
5220
diff
changeset
|
102 va_start(va, format); |
18000 | 103 vsnprintf(tmp, MSGSIZE_MAX, format, va); |
7195
a5b2566f3c2b
print only fatal/error/warning to stderr, others go to stdout
arpi
parents:
7058
diff
changeset
|
104 va_end(va); |
10853 | 105 tmp[MSGSIZE_MAX-2] = '\n'; |
6306
786ab42c10be
Extend maximum mp_msg message size, some translations need it or help message will be cutted.
atmos4
parents:
6048
diff
changeset
|
106 tmp[MSGSIZE_MAX-1] = 0; |
5102 | 107 |
16618 | 108 #ifdef HAVE_NEW_GUI |
5102 | 109 if(use_gui) |
16618 | 110 guiMessageBox(lev, tmp); |
5102 | 111 #endif |
112 | |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
113 #if defined(USE_ICONV) && defined(MSG_CHARSET) |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
114 if (mp_msg_charset && strcasecmp(mp_msg_charset, "noconv")) { |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
115 char tmp2[MSGSIZE_MAX]; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
116 size_t inlen = strlen(tmp), outlen = MSGSIZE_MAX; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
117 char *in = tmp, *out = tmp2; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
118 if (!old_charset || strcmp(old_charset, mp_msg_charset)) { |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
119 if (old_charset) { |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
120 free(old_charset); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
121 iconv_close(msgiconv); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
122 } |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
123 msgiconv = iconv_open(mp_msg_charset, MSG_CHARSET); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
124 old_charset = strdup(mp_msg_charset); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
125 } |
17931
ed9950b8200d
The fix in mp_msg.c avoids a core dump when iconv_open() fails, the other
albeu
parents:
17772
diff
changeset
|
126 if (msgiconv == (iconv_t)(-1)) { |
ed9950b8200d
The fix in mp_msg.c avoids a core dump when iconv_open() fails, the other
albeu
parents:
17772
diff
changeset
|
127 fprintf(stderr,"iconv: conversion from %s to %s unsupported\n" |
19549
5680696f964b
Mixed up from and to charsets in iconv open failure message.
reimar
parents:
18237
diff
changeset
|
128 ,MSG_CHARSET,mp_msg_charset); |
17931
ed9950b8200d
The fix in mp_msg.c avoids a core dump when iconv_open() fails, the other
albeu
parents:
17772
diff
changeset
|
129 }else{ |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
130 memset(tmp2, 0, MSGSIZE_MAX); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
131 while (iconv(msgiconv, &in, &inlen, &out, &outlen) == -1) { |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
132 if (!inlen || !outlen) |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
133 break; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
134 *out++ = *in++; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
135 outlen--; inlen--; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
136 } |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
137 strncpy(tmp, tmp2, MSGSIZE_MAX); |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
138 tmp[MSGSIZE_MAX-1] = 0; |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
139 tmp[MSGSIZE_MAX-2] = '\n'; |
17931
ed9950b8200d
The fix in mp_msg.c avoids a core dump when iconv_open() fails, the other
albeu
parents:
17772
diff
changeset
|
140 } |
17772
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
141 } |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
142 #endif |
0d7cc103ed1e
Automaticall convert message to console charset, use utf8 for GTK2 Gui
reimar
parents:
17742
diff
changeset
|
143 |
7200 | 144 #ifdef MSG_USE_COLORS |
10415 | 145 /* that's only a silly color test */ |
16379 | 146 #ifdef MP_ANNOY_ME |
7200 | 147 { int c; |
148 static int flag=1; | |
149 if(flag) | |
16379 | 150 for(c=0;c<24;c++) |
7200 | 151 printf("\033[%d;3%dm*** COLOR TEST %d ***\n",(c>7),c&7,c); |
152 flag=0; | |
153 } | |
154 #endif | |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
155 { unsigned char v_colors[10]={9,1,3,15,7,2,2,8,8,8}; |
16379 | 156 static const char *lev_text[]= { |
157 "FATAL", | |
158 "ERROR", | |
159 "WARN", | |
160 "HINT", | |
161 "INFO", | |
162 "STATUS", | |
163 "V", | |
164 "DGB2", | |
165 "DGB3", | |
21653
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
166 "DGB4", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
167 "DBG5", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
168 }; |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
169 static const char *mod_text[MSGT_MAX]= { |
16379 | 170 "GLOBAL", |
171 "CPLAYER", | |
172 "GPLAYER", | |
173 "VIDEOOUT", | |
174 "AUDIOOUT", | |
175 "DEMUXER", | |
176 "DS", | |
177 "DEMUX", | |
178 "HEADER", | |
179 "AVSYNC", | |
180 "AUTOQ", | |
181 "CFGPARSER", | |
182 "DECAUDIO", | |
183 "DECVIDEO", | |
184 "SEEK", | |
185 "WIN32", | |
186 "OPEN", | |
187 "DVD", | |
188 "PARSEES", | |
189 "LIRC", | |
190 "STREAM", | |
191 "CACHE", | |
192 "MENCODER", | |
193 "XACODEC", | |
194 "TV", | |
195 "OSDEP", | |
196 "SPUDEC", | |
197 "PLAYTREE", | |
198 "INPUT", | |
199 "VFILTER", | |
200 "OSD", | |
201 "NETWORK", | |
202 "CPUDETECT", | |
203 "CODECCFG", | |
204 "SWS", | |
205 "VOBSUB", | |
206 "SUBREADER", | |
207 "AFILTER", | |
208 "NETST", | |
21653
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
209 "MUXER", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
210 "OSDMENU", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
211 "IDENTIFY", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
212 "RADIO", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
213 "ASS", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
214 "LOADER", |
04cea12cd324
Fix possible crashes with colorized mplayer output
reimar
parents:
19549
diff
changeset
|
215 }; |
16379 | 216 |
16618 | 217 int c=v_colors[lev]; |
218 int c2=(mod+1)%15+1; | |
16379 | 219 static int header=1; |
16618 | 220 FILE *stream= (lev) <= MSGL_WARN ? stderr : stdout; |
16379 | 221 if(header){ |
16618 | 222 fprintf(stream, "\033[%d;3%dm%9s\033[0;37m: ",c2>>3,c2&7, mod_text[mod]); |
16379 | 223 } |
224 fprintf(stream, "\033[%d;3%dm",c>>3,c&7); | |
225 header= tmp[strlen(tmp)-1] == '\n' | |
17672
b238eeec6ae6
This now works correctly thanks to clear-to-end-of-line patch
ods15
parents:
17566
diff
changeset
|
226 ||tmp[strlen(tmp)-1] == '\r'; |
7200 | 227 } |
228 #endif | |
16618 | 229 if (lev <= MSGL_WARN){ |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
230 fprintf(stderr, "%s", tmp);fflush(stderr); |
7195
a5b2566f3c2b
print only fatal/error/warning to stderr, others go to stdout
arpi
parents:
7058
diff
changeset
|
231 } else { |
22005
77c4ad229db6
Cosmetics: remove tabs, almost all added during last patch, from
reimar
parents:
22002
diff
changeset
|
232 printf("%s", tmp);fflush(stdout); |
7195
a5b2566f3c2b
print only fatal/error/warning to stderr, others go to stdout
arpi
parents:
7058
diff
changeset
|
233 } |
1562 | 234 } |