Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
c1d3fe80
Commit
c1d3fe80
authored
Jul 08, 2015
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Jul 28, 2015
Browse files
Add text_segment_Delete to delete a specific segment
parent
ef4a8698
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/vlc_text_style.h
View file @
c1d3fe80
...
...
@@ -133,12 +133,19 @@ VLC_API void text_style_Delete( text_style_t * );
* This function will create a new text segment.
*
* You should use text_segment_ChainDelete to destroy it, to clean all
* the linked segments
.
* the linked segments
, or text_segment_Delete to free a specic one
*
* This duplicates the string passed as argument
*/
VLC_API
text_segment_t
*
text_segment_New
(
const
char
*
);
/**
* Delete a text segment and its content.
*
* This assumes the segment is not part of a chain
*/
VLC_API
void
text_segment_Delete
(
text_segment_t
*
);
/**
* This function will destroy a list of text segments allocated
* by text_segment_New.
...
...
src/libvlccore.sym
View file @
c1d3fe80
...
...
@@ -419,6 +419,7 @@ subpicture_region_Copy
subpicture_region_Delete
subpicture_region_New
text_segment_New
text_segment_Delete
text_segment_ChainDelete
text_segment_Copy
vlc_tls_ClientCreate
...
...
src/misc/text_style.c
View file @
c1d3fe80
...
...
@@ -105,15 +105,23 @@ text_segment_t *text_segment_New( const char *psz_text )
return
segment
;
}
void
text_segment_Delete
(
text_segment_t
*
segment
)
{
if
(
segment
!=
NULL
)
{
free
(
segment
->
psz_text
);
free
(
segment
);
text_style_Delete
(
segment
->
style
);
}
}
void
text_segment_ChainDelete
(
text_segment_t
*
segment
)
{
while
(
segment
!=
NULL
)
{
text_segment_t
*
p_next
=
segment
->
p_next
;
free
(
segment
->
psz_text
);
//text_style_Delete( segment->style );
free
(
segment
);
text_segment_Delete
(
segment
);
segment
=
p_next
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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