Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
65ffd1f8
Commit
65ffd1f8
authored
Sep 13, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add t140 FOURCC for always-
UTF-8
subs
parent
8287b68c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
modules/codec/subtitles/subsdec.c
modules/codec/subtitles/subsdec.c
+16
-7
No files found.
modules/codec/subtitles/subsdec.c
View file @
65ffd1f8
...
@@ -139,23 +139,28 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -139,23 +139,28 @@ static int OpenDecoder( vlc_object_t *p_this )
decoder_sys_t
*
p_sys
;
decoder_sys_t
*
p_sys
;
vlc_value_t
val
;
vlc_value_t
val
;
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
's'
,
'u'
,
'b'
,
't'
)
&&
switch
(
p_dec
->
fmt_in
.
i_codec
)
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
's'
,
's'
,
'a'
,
' '
)
)
{
{
case
VLC_FOURCC
(
's'
,
'u'
,
'b'
,
't'
):
case
VLC_FOURCC
(
's'
,
's'
,
'a'
,
' '
):
case
VLC_FOURCC
(
't'
,
'1'
,
'4'
,
'0'
):
break
;
default:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_dec
->
pf_decode_sub
=
DecodeBlock
;
p_dec
->
pf_decode_sub
=
DecodeBlock
;
/* Allocate the memory needed to store the decoder's structure */
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
(
decoder_sys_t
*
)
calloc
(
1
,
sizeof
(
decoder_sys_t
))
)
==
NULL
)
if
(
p_sys
==
NULL
)
{
{
msg_Err
(
p_dec
,
"out of memory"
);
msg_Err
(
p_dec
,
"out of memory"
);
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
/* init of p_sys */
/* init of p_sys */
memset
(
p_sys
,
0
,
sizeof
(
*
p_sys
)
);
p_sys
->
i_align
=
0
;
p_sys
->
i_align
=
0
;
p_sys
->
iconv_handle
=
(
vlc_iconv_t
)
-
1
;
p_sys
->
iconv_handle
=
(
vlc_iconv_t
)
-
1
;
p_sys
->
b_autodetect_utf8
=
VLC_FALSE
;
p_sys
->
b_autodetect_utf8
=
VLC_FALSE
;
...
@@ -166,6 +171,10 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -166,6 +171,10 @@ static int OpenDecoder( vlc_object_t *p_this )
TAB_INIT
(
p_sys
->
i_images
,
p_sys
->
pp_images
);
TAB_INIT
(
p_sys
->
i_images
,
p_sys
->
pp_images
);
char
*
psz_charset
=
NULL
;
char
*
psz_charset
=
NULL
;
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
't'
,
'1'
,
'4'
,
'0'
)
)
psz_charset
=
strdup
(
"UTF-8"
);
/* IUT T.140 is always using UTF-8 */
else
/* First try demux-specified encoding */
/* First try demux-specified encoding */
if
(
p_dec
->
fmt_in
.
subs
.
psz_encoding
&&
*
p_dec
->
fmt_in
.
subs
.
psz_encoding
)
if
(
p_dec
->
fmt_in
.
subs
.
psz_encoding
&&
*
p_dec
->
fmt_in
.
subs
.
psz_encoding
)
{
{
...
@@ -206,7 +215,7 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -206,7 +215,7 @@ static int OpenDecoder( vlc_object_t *p_this )
{
{
psz_charset
=
strdup
(
"UTF-8"
);
psz_charset
=
strdup
(
"UTF-8"
);
msg_Dbg
(
p_dec
,
"trying hard-coded character encoding: %s"
,
msg_Dbg
(
p_dec
,
"trying hard-coded character encoding: %s"
,
psz_charset
?:
"error"
);
psz_charset
?
psz_charset
:
"error"
);
}
}
if
(
psz_charset
==
NULL
)
if
(
psz_charset
==
NULL
)
...
@@ -472,7 +481,7 @@ char* GotoNextLine( char *psz_text )
...
@@ -472,7 +481,7 @@ char* GotoNextLine( char *psz_text )
return
p_newline
;
return
p_newline
;
}
}
/* Function now handles tags w
hich has
attribute values, and tries
/* Function now handles tags w
ith
attribute values, and tries
* to deal with &' commands too. It no longer modifies the string
* to deal with &' commands too. It no longer modifies the string
* in place, so that the original text can be reused
* in place, so that the original text can be reused
*/
*/
...
...
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