[vlc-devel] [PATCH 2/5] es_format: allow codecs to override spu styles

Francois Cartegnie fcvlcdev at free.fr
Sat Mar 22 07:15:12 CET 2014


---
 include/vlc_es.h     | 2 ++
 src/misc/es_format.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index d7f2d94..52fa706 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -356,6 +356,8 @@ struct subs_format_t
         int i_magazine;
         int i_page;
     } teletext;
+
+    text_style_t *p_style; /* Default styles to use */
 };
 
 /**
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 9028847..173e44f 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -31,6 +31,7 @@
 
 #include <vlc_common.h>
 #include <vlc_es.h>
+#include <vlc_text_style.h>
 
 
 /*****************************************************************************
@@ -475,6 +476,7 @@ int es_format_Copy( es_format_t *dst, const es_format_t *src )
     }
 
     dst->subs.psz_encoding = dst->subs.psz_encoding ? strdup( src->subs.psz_encoding ) : NULL;
+    dst->subs.p_style = src->subs.p_style ? text_style_Duplicate( src->subs.p_style ) : NULL;
 
     if( src->video.p_palette )
     {
@@ -523,6 +525,8 @@ void es_format_Clean( es_format_t *fmt )
     free( fmt->video.p_palette );
     free( fmt->subs.psz_encoding );
 
+    if ( fmt->subs.p_style ) text_style_Delete( fmt->subs.p_style );
+
     if( fmt->i_extra_languages > 0 && fmt->p_extra_languages )
     {
         int i;
-- 
1.8.5.3




More information about the vlc-devel mailing list