[vlc-commits] demux/ttml: fix compilation for #ifdef TTML_DEMUX_DEBUG

Filip Roséen git at videolan.org
Tue Jan 10 17:53:57 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Jan 10 16:49:12 2017 +0100| [bd7117fea4d7492899ab316147ee2157ff7407be] | committer: Francois Cartegnie

demux/ttml: fix compilation for #ifdef TTML_DEMUX_DEBUG

Since defining TTML_DEMUX_DEBUG would break compilation, these
changes:

 - manually "inlines" tt_textstream_Grab as it is only used once, and;
 - adds a missing argument to msg_Err

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd7117fea4d7492899ab316147ee2157ff7407be
---

 modules/demux/ttml.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 53eea2d..d34dcee 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -119,15 +119,6 @@ static bool tt_textstream_Append( tt_textstream_t *p_stream, const char *psz )
     return true;
 }
 
-#if 0
-static bool tt_textstream_Grab( tt_textstream_t *p_stream, char *psz )
-{
-    bool b_ret = tt_textstream_Append( p_stream, psz );
-    free( psz );
-    return b_ret;
-}
-#endif
-
 static bool tt_node_AttributesToText( tt_textstream_t *p_stream, const tt_node_t* p_node )
 {
     const vlc_dictionary_t* p_attr_dict = &p_node->attr_dict;
@@ -177,7 +168,11 @@ static bool tt_node_ToText( tt_textstream_t *p_stream, const tt_basenode_t *p_ba
                                       p_node->timings.i_begin,
                                       p_node->timings.i_end ) >= 0 )
             {
-                if( !tt_textstream_Grab( p_stream, psz_debug ) )
+                bool ret = tt_textstream_Append( p_stream, psz_debug );
+
+                free( psz_debug );
+
+                if( !ret )
                     return false;
             }
 #endif
@@ -457,7 +452,7 @@ int OpenDemux( vlc_object_t* p_this )
             tt_textstream_Finish( &stream, true );
         if( stream.p_block )
         {
-            msg_Dbg("%s\n", stream.p_block->p_buffer);
+            msg_Dbg( p_demux, "%s", stream.p_block->p_buffer );
             block_Release( stream.p_block );
         }
     }



More information about the vlc-commits mailing list