Commit 179c1855 authored by Bernie Purcell's avatar Bernie Purcell

Recognise subsdec-formatted variable when rendering USF and SRT subtitles, and

turn off styling of text if appropriate.
parent fc12cd71
...@@ -503,7 +503,10 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block ) ...@@ -503,7 +503,10 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
/* Remove formatting from string */ /* Remove formatting from string */
p_spu->p_region->psz_text = StripTags( psz_subtitle ); p_spu->p_region->psz_text = StripTags( psz_subtitle );
p_spu->p_region->psz_html = CreateHtmlSubtitle( psz_subtitle ); if( var_CreateGetBool( p_dec, "subsdec-formatted" ) )
{
p_spu->p_region->psz_html = CreateHtmlSubtitle( psz_subtitle );
}
p_spu->i_start = p_block->i_pts; p_spu->i_start = p_block->i_pts;
p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->i_stop = p_block->i_pts + p_block->i_length;
...@@ -777,8 +780,16 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec, char *psz_subtitle ...@@ -777,8 +780,16 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec, char *psz_subtitle
p_sys->i_align ); p_sys->i_align );
if( p_text_region ) if( p_text_region )
{
p_text_region->psz_text = CreatePlainText( p_text_region->psz_html ); p_text_region->psz_text = CreatePlainText( p_text_region->psz_html );
if( ! var_CreateGetBool( p_dec, "subsdec-formatted" ) )
{
free( p_text_region->psz_html );
p_text_region->psz_html = NULL;
}
}
if( !p_region_first ) if( !p_region_first )
{ {
p_region_first = p_region_upto = p_text_region; p_region_first = p_region_upto = p_text_region;
...@@ -807,6 +818,14 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec, char *psz_subtitle ...@@ -807,6 +818,14 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec, char *psz_subtitle
psz_end - psz_subtitle, psz_end - psz_subtitle,
p_sys->i_align ); p_sys->i_align );
if( p_text_region )
{
if( ! var_CreateGetBool( p_dec, "subsdec-formatted" ) )
{
free( p_text_region->psz_html );
p_text_region->psz_html = NULL;
}
}
if( !p_region_first ) if( !p_region_first )
{ {
p_region_first = p_region_upto = p_text_region; p_region_first = p_region_upto = p_text_region;
......
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