Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7439ce19
Commit
7439ce19
authored
Sep 06, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: take LANG value from --language and the HKCU value
parent
885ec1a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
bin/winvlc.c
bin/winvlc.c
+31
-0
No files found.
bin/winvlc.c
View file @
7439ce19
...
...
@@ -108,6 +108,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
char
*
argv
[
argc
+
3
];
BOOL
crash_handling
=
TRUE
;
int
j
=
0
;
char
*
lang
=
NULL
;
argv
[
j
++
]
=
FromWide
(
L"--media-library"
);
argv
[
j
++
]
=
FromWide
(
L"--no-ignore-config"
);
...
...
@@ -118,6 +119,12 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
crash_handling
=
FALSE
;
continue
;
/* don't give argument to libvlc */
}
if
(
!
wcsncmp
(
wargv
[
i
],
L"--language"
,
10
)
)
{
if
(
i
<
argc
-
1
&&
wcsncmp
(
wargv
[
i
+
1
],
L"--"
,
2
))
lang
=
FromWide
(
wargv
[
++
i
]);
continue
;
}
argv
[
j
++
]
=
FromWide
(
wargv
[
i
]);
}
...
...
@@ -141,6 +148,30 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
_setmode
(
STDIN_FILENO
,
_O_BINARY
);
/* Needed for pipes */
/* */
if
(
!
lang
)
{
HKEY
h_key
;
if
(
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
TEXT
(
"Software
\\
VideoLAN
\\
VLC
\\
"
),
0
,
KEY_READ
,
&
h_key
)
==
ERROR_SUCCESS
)
{
TCHAR
szData
[
256
];
DWORD
len
=
256
;
if
(
RegQueryValueEx
(
h_key
,
TEXT
(
"Lang"
),
NULL
,
NULL
,
(
LPBYTE
)
&
szData
,
&
len
)
==
ERROR_SUCCESS
)
lang
=
FromWide
(
szData
);
}
}
if
(
lang
&&
strncmp
(
lang
,
"auto"
,
4
)
)
{
char
*
tmp
;
if
(
asprintf
(
&
tmp
,
"LANG=%s"
,
lang
)
!=
-
1
)
{
putenv
(
tmp
);
free
(
tmp
);
}
}
free
(
lang
);
/* Initialize libvlc */
libvlc_instance_t
*
vlc
;
vlc
=
libvlc_new
(
argc
,
(
const
char
**
)
argv
);
...
...
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