[vlc-devel] commit: asf.c: fix variable usage (Ilkka Ollakka )

git version control git at videolan.org
Tue Oct 6 22:59:35 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue Oct  6 23:54:59 2009 +0300| [17630b540feb526404d0e51e357609b8cccf7397] | committer: Ilkka Ollakka 

asf.c: fix variable usage

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

 modules/mux/asf.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index cd8c8b4..590b01e 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -30,6 +30,8 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
@@ -933,6 +935,7 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
     int i_ci_size, i_cm_size = 0, i_cd_size = 0;
     block_t *out;
     bo_t bo;
+    tk=NULL;
 
     msg_Dbg( p_mux, "Asf muxer creating header" );
 
@@ -1063,7 +1066,7 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
         bo_addle_u32( &bo, 0 );                 /* Alternate Initial buffer fullness */
         bo_addle_u32( &bo, 0 );                 /* Maximum object size (0 = unkown) */
         bo_addle_u32( &bo, 0x02 );              /* Flags (seekable) */
-        bo_addle_u16( &bo, tk->i_id ); /* Stream number */
+        bo_addle_u16( &bo, p_track->i_id ); /* Stream number */
         bo_addle_u16( &bo, 0 ); /* Stream language index */
         bo_addle_u64( &bo, i_avg_duration );    /* Average time per frame */
         bo_addle_u16( &bo, 0 ); /* Stream name count */
@@ -1076,12 +1079,14 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
         int64_t i_num, i_den;
         unsigned int i_dst_num, i_dst_den;
         asf_track_t *tk;
+        tk=NULL;
 
         for( i = 0; i < vlc_array_count( p_sys->p_tracks ); i++ )
         {
             tk = vlc_array_item_at_index( p_sys->p_tracks, i );
             if( tk->i_cat == VIDEO_ES ) break;
         }
+        assert( tk != NULL );
 
         i_num = tk->fmt.video.i_aspect *
             (int64_t)tk->fmt.video.i_height;




More information about the vlc-devel mailing list