Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
942cd8fe
Commit
942cd8fe
authored
Nov 12, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Latin-1 rather than local charset for ASX files
parent
87045781
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
17 deletions
+30
-17
modules/demux/playlist/asx.c
modules/demux/playlist/asx.c
+30
-17
No files found.
modules/demux/playlist/asx.c
View file @
942cd8fe
/*****************************************************************************
* asx.c : ASX playlist format import
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* Copyright (C) 2005
-2006
the VideoLAN team
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
...
...
@@ -53,29 +53,42 @@ struct demux_sys_t
static
int
Demux
(
demux_t
*
p_demux
);
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
);
static
int
StoreString
(
demux_t
*
p_demux
,
char
**
ppsz_string
,
char
*
psz_source_start
,
char
*
psz_source_end
)
static
int
StoreString
(
demux_t
*
p_demux
,
char
**
ppsz_string
,
const
char
*
psz_source_start
,
const
char
*
psz_source_end
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
int
i_strlen
=
psz_source_end
-
psz_source_start
;
if
(
i_strlen
<
1
)
return
VLC_EGENERIC
;
unsigned
len
=
psz_source_end
-
psz_source_start
;
if
(
*
ppsz_string
)
free
(
*
ppsz_string
);
*
ppsz_string
=
malloc
(
i_strlen
*
sizeof
(
char
)
+
1
);
memcpy
(
*
ppsz_string
,
psz_source_start
,
i_strlen
);
(
*
ppsz_string
)[
i_strlen
]
=
'\0'
;
char
*
buf
=
*
ppsz_string
=
malloc
((
len
*
(
1
+
!
p_sys
->
b_utf8
))
+
1
);
if
(
buf
==
NULL
)
return
VLC_ENOMEM
;
if
(
p_sys
->
b_utf8
)
EnsureUTF8
(
*
ppsz_string
);
{
memcpy
(
buf
,
psz_source_start
,
len
);
(
*
ppsz_string
)[
len
]
=
'\0'
;
EnsureUTF8
(
*
ppsz_string
);
}
else
{
char
*
psz_temp
;
psz_temp
=
FromLocaleDup
(
*
ppsz_string
);
if
(
psz_temp
)
/* Latin-1 -> UTF-8 */
for
(
unsigned
i
=
0
;
i
<
len
;
i
++
)
{
unsigned
char
c
=
psz_source_start
[
i
];
if
(
c
&
0x80
)
{
free
(
*
ppsz_string
);
*
ppsz_string
=
psz_temp
;
}
else
EnsureUTF8
(
*
ppsz_string
);
*
buf
++
=
0xc0
|
(
c
>>
6
);
*
buf
++
=
0x80
|
(
c
&
0x3f
);
}
else
*
buf
++
=
c
;
}
*
buf
++
=
'\0'
;
buf
=
*
ppsz_string
=
realloc
(
*
ppsz_string
,
buf
-
*
ppsz_string
);
}
return
VLC_SUCCESS
;
}
...
...
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