Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
f85d7f60
Commit
f85d7f60
authored
Aug 13, 2015
by
François Grisez
Browse files
MKV: Convert paths from UTF-8 to ACP before passing them to StreamOpen()
parent
cbdcaacb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/videofilters/mkv.c
View file @
f85d7f60
...
...
@@ -902,9 +902,23 @@ static ms_bool_t matroska_load_file(Matroska *obj) {
return
TRUE
;
}
static
int
matroska_open_file
(
Matroska
*
obj
,
const
char
path
[]
,
MatroskaOpenMode
mode
)
{
static
int
matroska_open_file
(
Matroska
*
obj
,
const
char
*
path
,
MatroskaOpenMode
mode
)
{
int
err
=
0
;
#ifdef _MSC_VER
wchar_t
wpath
[
MAX_PATH
+
1
];
char
mbpath
[
MAX_PATH
+
1
];
if
(
MultiByteToWideChar
(
CP_UTF8
,
0
,
path
,
-
1
,
wpath
,
MAX_PATH
+
1
)
==
0
)
{
ms_error
(
"Could not convert %s into UTF-16"
,
path
);
return
-
1
;
}
if
(
WideCharToMultiByte
(
CP_ACP
,
0
,
wpath
,
-
1
,
mbpath
,
MAX_PATH
+
1
,
NULL
,
NULL
)
==
0
)
{
ms_error
(
"Could not convert %s from UTF-16 to ACP"
,
path
);
return
-
1
;
}
path
=
mbpath
;
#endif
switch
(
mode
)
{
case
MKV_OPEN_CREATE
:
if
((
obj
->
output
=
StreamOpen
(
obj
->
p
,
path
,
SFLAG_WRONLY
|
SFLAG_CREATE
))
==
NULL
)
{
...
...
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