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
b8f8588e
Commit
b8f8588e
authored
Mar 26, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codec: substext: process asprintf returnval
parent
8a8767fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
modules/codec/substext.h
modules/codec/substext.h
+17
-8
No files found.
modules/codec/substext.h
View file @
b8f8588e
...
...
@@ -89,7 +89,7 @@ static void HtmlAppend( char **ppsz_dst, const char *psz_src,
const
segment_style_t
*
p_styles
,
const
float
f_scale
)
{
if
(
!
ppsz_dst
)
return
;
int
i_
ignore
;
VLC_UNUSED
(
i_ignore
)
;
int
i_
return
;
char
*
psz_subtext
=
NULL
;
char
*
psz_text
=
NULL
;
char
*
psz_fontsize
=
NULL
;
...
...
@@ -100,14 +100,20 @@ static void HtmlAppend( char **ppsz_dst, const char *psz_src,
MakeHtmlNewLines
(
&
psz_encoded
);
if
(
p_styles
->
i_color
&
0xFF000000
)
//ARGB
i_ignore
=
asprintf
(
&
psz_color
,
" color=
\"
#%6x
\"
"
,
{
i_return
=
asprintf
(
&
psz_color
,
" color=
\"
#%6x
\"
"
,
p_styles
->
i_color
&
0x00FFFFFF
);
if
(
i_return
<
0
)
psz_color
=
NULL
;
}
if
(
p_styles
->
i_fontsize
>
0
&&
f_scale
>
0
)
i_ignore
=
asprintf
(
&
psz_fontsize
,
" size=
\"
%u
\"
"
,
{
i_return
=
asprintf
(
&
psz_fontsize
,
" size=
\"
%u
\"
"
,
(
unsigned
)
(
f_scale
*
p_styles
->
i_fontsize
)
);
if
(
i_return
<
0
)
psz_fontsize
=
NULL
;
}
i_
ignore
=
asprintf
(
&
psz_subtext
,
"%s%s%s%s%s%s%s"
,
i_
return
=
asprintf
(
&
psz_subtext
,
"%s%s%s%s%s%s%s"
,
(
p_styles
->
i_flags
&
STYLE_UNDERLINE
)
?
"<u>"
:
""
,
(
p_styles
->
i_flags
&
STYLE_BOLD
)
?
"<b>"
:
""
,
(
p_styles
->
i_flags
&
STYLE_ITALIC
)
?
"<i>"
:
""
,
...
...
@@ -116,13 +122,15 @@ static void HtmlAppend( char **ppsz_dst, const char *psz_src,
(
p_styles
->
i_flags
&
STYLE_BOLD
)
?
"</b>"
:
""
,
(
p_styles
->
i_flags
&
STYLE_UNDERLINE
)
?
"</u>"
:
""
);
if
(
i_return
<
0
)
psz_subtext
=
NULL
;
if
(
psz_color
||
psz_fontsize
)
{
i_
ignore
=
asprintf
(
&
psz_text
,
"<font%s%s>%s</font>"
,
i_
return
=
asprintf
(
&
psz_text
,
"<font%s%s>%s</font>"
,
psz_color
?
psz_color
:
""
,
psz_fontsize
?
psz_fontsize
:
""
,
psz_subtext
);
if
(
i_return
<
0
)
psz_text
=
NULL
;
free
(
psz_subtext
);
}
else
...
...
@@ -136,7 +144,8 @@ static void HtmlAppend( char **ppsz_dst, const char *psz_src,
if
(
*
ppsz_dst
)
{
char
*
psz_dst
=
*
ppsz_dst
;
i_ignore
=
asprintf
(
ppsz_dst
,
"%s%s"
,
psz_dst
,
psz_text
);
i_return
=
asprintf
(
ppsz_dst
,
"%s%s"
,
psz_dst
,
psz_text
);
if
(
i_return
<
0
)
ppsz_dst
=
NULL
;
free
(
psz_dst
);
free
(
psz_text
);
}
...
...
@@ -153,8 +162,8 @@ static char *SegmentsToHtml( segment_t *p_head, const float f_scale )
HtmlAppend
(
&
psz_dst
,
p_head
->
psz_string
,
&
p_head
->
styles
,
f_scale
);
p_head
=
p_head
->
p_next
;
}
int
i_
ignore
=
asprintf
(
&
psz_ret
,
"<text>%s</text>"
,
psz_dst
);
VLC_UNUSED
(
i_ignore
)
;
int
i_
ret
=
asprintf
(
&
psz_ret
,
"<text>%s</text>"
,
psz_dst
);
if
(
i_ret
<
0
)
psz_ret
=
NULL
;
free
(
psz_dst
);
return
psz_ret
;
}
...
...
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