[vlc-devel] [PATCH 1/3] subvtt: move ifdef/variable to avoid unused warnings

Alexandre Janniaux ajanni at videolabs.io
Tue Mar 10 22:34:13 CET 2020


webvtt_domnode_GetPlaybackTime and p_sys are only used by the code
conditionnally compiled against HAVE_CSS.
---
 modules/codec/webvtt/subsvtt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/webvtt/subsvtt.c b/modules/codec/webvtt/subsvtt.c
index 3e98acd499..f20f734f7b 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -551,6 +551,7 @@ static webvtt_dom_node_t * webvtt_domnode_getFirstChild( webvtt_dom_node_t *p_no
 }
 #define webvtt_domnode_getFirstChild(a) webvtt_domnode_getFirstChild((webvtt_dom_node_t *)a)
 
+#ifdef HAVE_CSS
 static vlc_tick_t webvtt_domnode_GetPlaybackTime( const webvtt_dom_node_t *p_node, bool b_end )
 {
     for( ; p_node; p_node = p_node->p_parent )
@@ -572,7 +573,6 @@ static vlc_tick_t webvtt_domnode_GetPlaybackTime( const webvtt_dom_node_t *p_nod
     return VLC_TICK_INVALID;
 }
 
-#ifdef HAVE_CSS
 static bool webvtt_domnode_Match_Class( const webvtt_dom_node_t *p_node, const char *psz )
 {
     const size_t i_len = strlen( psz );
@@ -1313,7 +1313,6 @@ static text_style_t * ComputeStyle( decoder_t *p_dec, const webvtt_dom_node_t *p
     text_style_t *p_style = NULL;
     text_style_t *p_dfltstyle = NULL;
     vlc_tick_t i_tagtime = -1;
-    decoder_sys_t *p_sys = p_dec->p_sys;
 
     for( const webvtt_dom_node_t *p_node = p_leaf ; p_node; p_node = p_node->p_parent )
     {
@@ -1369,6 +1368,7 @@ static text_style_t * ComputeStyle( decoder_t *p_dec, const webvtt_dom_node_t *p
                 else if ( !strcmp( p_tagnode->psz_tag, "v" ) && p_tagnode->psz_attrs )
                 {
 #ifdef HAVE_CSS
+                    decoder_sys_t *p_sys = p_dec->p_sys;
                     if( p_sys->p_css_rules == NULL ) /* Only auto style when no CSS sheet */
 #endif
                     {
-- 
2.25.1



More information about the vlc-devel mailing list