Skip to content

Commit b6e173f

Browse files
remitaminefcartegnie
authored andcommitted
ttml: correct element style resolution order
the element style resolution order should start with Inline Styling than Referential Styling than Region Style Inheritance without overriding. if we have: <style xml:id="captionStyle" tts:color="red"/> and: <span style="captionStyle" tts:color="green">test</span> so in the example the color should be green not red. Signed-off-by: Francois Cartegnie <[email protected]>
1 parent 4f3195a commit b6e173f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/codec/ttml/substtml.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,17 +479,17 @@ static ttml_style_t * InheritTTMLStyles( ttml_context_t *p_ctx, tt_node_t *p_nod
479479
/* Merge dics backwards without overwriting */
480480
for( ; p_node; p_node = p_node->p_parent )
481481
{
482-
const char *psz_regionid = (const char *)
483-
vlc_dictionary_value_for_key( &p_node->attr_dict, "region" );
484-
if( psz_regionid )
485-
DictMergeWithRegionID( p_ctx, psz_regionid, &merged );
482+
DictionnaryMerge( &p_node->attr_dict, &merged );
486483

487484
const char *psz_styleid = (const char *)
488485
vlc_dictionary_value_for_key( &p_node->attr_dict, "style" );
489486
if( psz_styleid )
490487
DictMergeWithStyleID( p_ctx, psz_styleid, &merged );
491488

492-
DictionnaryMerge( &p_node->attr_dict, &merged );
489+
const char *psz_regionid = (const char *)
490+
vlc_dictionary_value_for_key( &p_node->attr_dict, "region" );
491+
if( psz_regionid )
492+
DictMergeWithRegionID( p_ctx, psz_regionid, &merged );
493493
}
494494

495495
if( merged.i_size && merged.p_entries[0] && (p_ttml_style = ttml_style_New()) )

0 commit comments

Comments
 (0)