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
e8b9642e
Commit
e8b9642e
authored
Oct 26, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NSC: use FromCharset()
parent
b507be16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
35 deletions
+4
-35
modules/demux/nsc.c
modules/demux/nsc.c
+4
-35
No files found.
modules/demux/nsc.c
View file @
e8b9642e
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
#include <vlc_demux.h>
#include <vlc_charset.h>
#include <ctype.h>
#include <ctype.h>
#define MAX_LINE 16024
#define MAX_LINE 16024
...
@@ -147,13 +148,8 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
...
@@ -147,13 +148,8 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
unsigned
int
length
;
unsigned
int
length
;
unsigned
char
encoding_type
;
unsigned
char
encoding_type
;
vlc_iconv_t
conv
;
size_t
buf16_size
;
unsigned
char
*
buf16
;
unsigned
char
*
buf16
;
const
char
*
p_buf16
;
size_t
buf8_size
;
char
*
buf8
;
char
*
buf8
;
char
*
p_buf8
;
char
*
p_input
=
p_encoded
;
char
*
p_input
=
p_encoded
;
...
@@ -210,8 +206,7 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
...
@@ -210,8 +206,7 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
return
NULL
;
return
NULL
;
}
}
buf16_size
=
length
;
buf16
=
malloc
(
length
);
buf16
=
malloc
(
buf16_size
);
if
(
buf16
==
NULL
)
if
(
buf16
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -225,39 +220,13 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
...
@@ -225,39 +220,13 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
}
}
}
}
buf8
_size
=
length
;
buf8
=
FromCharset
(
"UTF-16LE"
,
buf16
,
length
)
;
buf8
=
malloc
(
buf8_size
+
1
);
free
(
buf16
);
if
(
buf8
==
NULL
)
if
(
buf8
==
NULL
)
{
free
(
buf16
);
return
NULL
;
}
conv
=
vlc_iconv_open
(
"UTF-8"
,
"UTF-16LE"
);
if
(
conv
==
(
vlc_iconv_t
)(
-
1
)
)
{
msg_Err
(
p_demux
,
"iconv_open failed"
);
free
(
buf16
);
free
(
buf8
);
return
NULL
;
}
p_buf8
=
buf8
;
p_buf16
=
(
const
char
*
)
buf16
;
if
(
vlc_iconv
(
conv
,
&
p_buf16
,
&
buf16_size
,
&
p_buf8
,
&
buf8_size
)
==
(
size_t
)(
-
1
)
)
{
{
msg_Err
(
p_demux
,
"iconv failed"
);
msg_Err
(
p_demux
,
"iconv failed"
);
return
NULL
;
return
NULL
;
}
}
else
{
buf8
[
length
-
buf8_size
]
=
'\0'
;
}
vlc_iconv_close
(
conv
);
free
(
buf16
);
return
buf8
;
return
buf8
;
}
}
...
...
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