Commit 6b45f45e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

subpicture: replace plain text by text_segment list

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3696f331
......@@ -64,6 +64,7 @@ struct subpicture_region_t
int i_align; /**< alignment within a region */
int i_alpha; /**< transparency */
text_segment_t *p_text; /**< subtitle text, made of a list of segments */
char *psz_text; /**< text string comprising this region */
char *psz_html; /**< HTML version of subtitle (NULL = use psz_text) */
text_style_t *p_style; /**< a description of the text style formatting */
......
......@@ -248,7 +248,7 @@ void subpicture_region_Delete( subpicture_region_t *p_region )
free( p_region->fmt.p_palette );
free( p_region->psz_text );
text_segment_ChainDelete( p_region->p_text );
free( p_region->psz_html );
if( p_region->p_style )
text_style_Delete( p_region->p_style );
......@@ -304,7 +304,7 @@ subpicture_region_t* subpicture_region_Copy( subpicture_region_t *p_region_src )
p_region_dst->i_align = p_region_src->i_align;
p_region_dst->i_alpha = p_region_src->i_alpha;
p_region_dst->psz_text = p_region_src->psz_text ? strdup(p_region_src->psz_text) : NULL;
p_region_dst->p_text = text_segment_Copy( p_region_src->p_text );
p_region_dst->psz_html = p_region_src->psz_html ? strdup(p_region_src->psz_html) : NULL;
if (p_region_src->p_style != NULL) {
p_region_dst->p_style = text_style_New();
......
......@@ -113,7 +113,7 @@ static subpicture_region_t * vout_OSDEpgText(const char *text,
return NULL;
/* Set subpicture parameters */
region->psz_text = strdup(text);
region->p_text = text_segment_New(text);
region->i_align = 0;
region->i_x = x;
region->i_y = y;
......
......@@ -74,7 +74,7 @@ static void OSDTextUpdate(subpicture_t *subpic,
if (!r)
return;
r->psz_text = strdup(sys->text);
r->p_text = text_segment_New( sys->text );
const float margin_ratio = 0.04;
const int margin_h = margin_ratio * fmt_dst->i_visible_width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment