Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
4e29ccba
Commit
4e29ccba
authored
Feb 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use C locale when formatting error messages in the log
parent
a72aea60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
include/vlc_fixups.h
include/vlc_fixups.h
+2
-1
src/libvlc.h
src/libvlc.h
+2
-0
src/misc/messages.c
src/misc/messages.c
+11
-2
No files found.
include/vlc_fixups.h
View file @
4e29ccba
...
...
@@ -170,7 +170,8 @@ static inline char *getenv (const char *name)
#endif
#ifndef HAVE_USELOCALE
#define LC_NUMERIC_MASK 0
#define LC_NUMERIC_MASK 0
#define LC_MESSAGES_MASK 0
typedef
void
*
locale_t
;
static
inline
locale_t
uselocale
(
locale_t
loc
)
{
...
...
src/libvlc.h
View file @
4e29ccba
...
...
@@ -100,6 +100,8 @@ typedef struct msg_bank_t
#ifdef UNDER_CE
FILE
*
logfile
;
#endif
locale_t
locale
;
}
msg_bank_t
;
void
msg_Create
(
libvlc_int_t
*
);
...
...
src/misc/messages.c
View file @
4e29ccba
...
...
@@ -35,7 +35,7 @@
#include <vlc_common.h>
#include <stdarg.h>
/* va_list for BSD */
#include <locale.h>
#include <errno.h>
/* errno */
#ifdef WIN32
...
...
@@ -109,6 +109,9 @@ void msg_Create (libvlc_int_t *p_libvlc)
QUEUE
.
i_sub
=
0
;
QUEUE
.
pp_sub
=
NULL
;
/* C locale to get error messages in English in the logs */
bank
->
locale
=
newlocale
(
LC_MESSAGES_MASK
,
"C"
,
(
locale_t
)
0
);
#ifdef UNDER_CE
QUEUE
.
logfile
=
CreateFile
(
L"vlc-log.txt"
,
GENERIC_WRITE
,
...
...
@@ -175,6 +178,8 @@ void msg_Destroy (libvlc_int_t *p_libvlc)
#ifdef UNDER_CE
CloseHandle
(
QUEUE
.
logfile
);
#endif
if
(
bank
->
locale
!=
(
locale_t
)
0
)
freelocale
(
bank
->
locale
);
vlc_dictionary_clear
(
&
priv
->
msg_enabled_objects
,
NULL
,
NULL
);
...
...
@@ -288,6 +293,9 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
(
p_this
->
i_flags
&
OBJECT_FLAGS_NODBG
&&
i_type
==
VLC_MSG_DBG
)
)
return
;
msg_bank_t
*
bank
=
&
QUEUE
;
locale_t
locale
=
uselocale
(
bank
->
locale
);
#ifndef __GLIBC__
/* Expand %m to strerror(errno) - only once */
char
buf
[
strlen
(
psz_format
)
+
2001
],
*
ptr
;
...
...
@@ -373,8 +381,10 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
va_end
(
args
);
fputs
(
"
\n
"
,
stderr
);
vlc_restorecancel
(
canc
);
uselocale
(
locale
);
return
;
}
uselocale
(
locale
);
msg_item_t
*
p_item
=
malloc
(
sizeof
(
*
p_item
));
if
(
p_item
==
NULL
)
...
...
@@ -421,7 +431,6 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
PrintMsg
(
p_this
,
p_item
);
msg_bank_t
*
bank
=
&
QUEUE
;
vlc_rwlock_rdlock
(
&
bank
->
lock
);
for
(
int
i
=
0
;
i
<
bank
->
i_sub
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment