[vlc-commits] input: fetch demux attachment once, not twice (fixes #11966)

Rémi Denis-Courmont git at videolan.org
Fri Aug 15 19:17:22 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 15 20:07:07 2014 +0300| [fdb9f79e5ffdb566a1b5f5940d83f8cd93f08783] | committer: Rémi Denis-Courmont

input: fetch demux attachment once, not twice (fixes #11966)

This was inefficient and caused attachments from the meta engine or from
the slave demuxers to get lost.

Note that those attachments will still get lost later if the master
demuxer sets the metadata update flag (which affects the Ogg demuxer
only so far), or when adding a slave input.

All regressions introduced in e4673369e8356c84ca99b66fb222dee07c8e4962.

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

 src/input/input.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 91518ff..43b1dbb 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1173,8 +1173,6 @@ static void InitPrograms( input_thread_t * p_input )
 
 static int Init( input_thread_t * p_input )
 {
-    vlc_meta_t *p_meta;
-
     for( int i = 0; i < p_input->p->p_item->i_options; i++ )
     {
         if( !strncmp( p_input->p->p_item->ppsz_options[i], "meta-file", 9 ) )
@@ -1253,8 +1251,8 @@ static int Init( input_thread_t * p_input )
                  p_input->p->b_out_pace_control ? "async" : "sync" );
     }
 
-    p_meta = vlc_meta_New();
-    if( p_meta )
+    vlc_meta_t *p_meta = vlc_meta_New();
+    if( p_meta != NULL )
     {
         /* Get meta data from users */
         InputMetaUser( p_input, p_meta );
@@ -1266,8 +1264,8 @@ static int Init( input_thread_t * p_input )
         for( int i = 0; i < p_input->p->i_slave; i++ )
             InputSourceMeta( p_input, p_input->p->slave[i], p_meta );
 
-        /* */
-        InputUpdateMeta( p_input, p_meta );
+        es_out_ControlSetMeta( p_input->p->p_es_out, p_meta );
+        vlc_meta_Delete( p_meta );
     }
 
     msg_Dbg( p_input, "`%s' successfully opened",



More information about the vlc-commits mailing list