[vlc-devel] [PATCH] mux:asf: write the SAR in the track we found

Steve Lhomme robux4 at videolabs.io
Fri Jul 7 12:57:11 CEST 2017


We may write in an invalid tk if none are matched before.
---
 modules/mux/asf.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index 809caf60ad..15890e59b9 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -996,14 +996,15 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
             if( tk->i_cat == VIDEO_ES &&
                 tk->fmt.video.i_sar_num != 0 &&
                 tk->fmt.video.i_sar_den != 0 )
+            {
+                vlc_ureduce( &i_dst_num, &i_dst_den,
+                             tk->fmt.video.i_sar_num,
+                             tk->fmt.video.i_sar_den, 0 );
                 break;
+            }
         }
         assert( tk != NULL );
 
-        vlc_ureduce( &i_dst_num, &i_dst_den,
-                     tk->fmt.video.i_sar_num,
-                     tk->fmt.video.i_sar_den, 0 );
-
         msg_Dbg( p_mux, "pixel aspect-ratio: %i/%i", i_dst_num, i_dst_den );
 
         bo_add_guid ( &bo, &asf_object_metadata_guid );
-- 
2.12.1



More information about the vlc-devel mailing list