]> git.sesse.net Git - vlc/commitdiff
Factorized extended header search (asf).
authorLaurent Aimar <fenrir@videolan.org>
Sat, 13 Feb 2010 20:31:45 +0000 (21:31 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 13 Feb 2010 20:59:04 +0000 (21:59 +0100)
modules/demux/asf/asf.c

index a5e1e6224bd5c3b1e04a5d1f264622d83e7c3dba..3f1e42402c6aed8f63c4361fd7ea88e7435bd185 100644 (file)
@@ -732,13 +732,15 @@ static int DemuxInit( demux_t *p_demux )
                                                   &asf_object_index_guid, 0 );
     const bool b_index = p_index && p_index->i_index_entry_count;
 
+    /* Find the extended header if any */
+    asf_object_t *p_hdr_ext = ASF_FindObject( p_sys->p_root->p_hdr,
+                                              &asf_object_header_extension_guid, 0 );
 
     for( unsigned i_stream = 0; i_stream < p_sys->i_track; i_stream++ )
     {
         asf_track_t    *tk;
         asf_object_stream_properties_t *p_sp;
         asf_object_extended_stream_properties_t *p_esp;
-        asf_object_t *p_hdr_ext;
         bool b_access_selected;
 
         p_sp = ASF_FindObject( p_sys->p_root->p_hdr,
@@ -766,8 +768,6 @@ static int DemuxInit( demux_t *p_demux )
         }
 
         /* Find the associated extended_stream_properties if any */
-        p_hdr_ext = ASF_FindObject( p_sys->p_root->p_hdr,
-                                    &asf_object_header_extension_guid, 0 );
         if( p_hdr_ext )
         {
             int i_ext_stream = ASF_CountObject( p_hdr_ext,