Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
711b342d
Commit
711b342d
authored
Mar 11, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix memleak when not using Mac OS
- Error handling clean up
parent
f22bfe80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
modules/codec/subsdec.c
modules/codec/subsdec.c
+11
-5
No files found.
modules/codec/subsdec.c
View file @
711b342d
...
...
@@ -154,9 +154,9 @@ static int OpenDecoder( vlc_object_t *p_this )
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
{
msg_Err
(
p_dec
,
"out of memory"
);
return
VLC_E
GENERIC
;
return
VLC_E
NOMEM
;
}
/* init of p_sys */
p_sys
->
i_align
=
0
;
p_sys
->
iconv_handle
=
(
vlc_iconv_t
)
-
1
;
...
...
@@ -180,13 +180,19 @@ static int OpenDecoder( vlc_object_t *p_this )
var_Get
(
p_dec
,
"subsdec-encoding"
,
&
val
);
if
(
!
strcmp
(
val
.
psz_string
,
DEFAULT_NAME
)
)
{
char
*
psz_charset
=
(
char
*
)
malloc
(
100
);
char
*
psz_charset
;
#ifdef __APPLE__
/* Most subtitles are not in UTF-8, which is the default on Mac OS X */
sprintf
(
psz_charset
,
"ISO-8859-1"
);
psz_charset
=
strdup
(
"ISO-8859-1"
);
#else
vlc_current_charset
(
&
psz_charset
);
#endif
if
(
psz_charset
==
NULL
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_sys
->
iconv_handle
=
vlc_iconv_open
(
"UTF-8"
,
psz_charset
);
msg_Dbg
(
p_dec
,
"using default character encoding: %s"
,
psz_charset
);
free
(
psz_charset
);
...
...
@@ -206,7 +212,7 @@ static int OpenDecoder( vlc_object_t *p_this )
}
if
(
val
.
psz_string
)
free
(
val
.
psz_string
);
}
var_Create
(
p_dec
,
"subsdec-align"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"subsdec-align"
,
&
val
);
p_sys
->
i_align
=
val
.
i_int
;
...
...
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