[vlc-commits] demux: mp4: force track timescale to nonzero

Francois Cartegnie git at videolan.org
Sat Apr 29 15:08:32 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Apr 29 12:24:59 2017 +0200| [2b48bf55e00079509b39a7ace83b006496a09255] | committer: Francois Cartegnie

demux: mp4: force track timescale to nonzero

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

 modules/demux/mp4/mp4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 8b8b812a1e..4c4322b758 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3053,13 +3053,12 @@ static void MP4_TrackSetup( demux_t *p_demux, mp4_track_t *p_track,
         return;
     }
 
-    p_track->i_timescale = BOXDATA(p_mdhd)->i_timescale;
-    if( p_track->i_timescale == 0 )
+    if( BOXDATA(p_mdhd)->i_timescale == 0 )
     {
-        p_track->i_timescale = p_sys->i_timescale;
         msg_Warn( p_demux, "Invalid track timescale " );
         return;
     }
+    p_track->i_timescale = BOXDATA(p_mdhd)->i_timescale;
 
     memcpy( &language, BOXDATA(p_mdhd)->rgs_language, 3 );
     p_track->b_mac_encoding = BOXDATA(p_mdhd)->b_mac_encoding;
@@ -3326,6 +3325,7 @@ static void MP4_TrackInit( mp4_track_t *p_track )
 {
     memset( p_track, 0, sizeof(mp4_track_t) );
     es_format_Init( &p_track->fmt, 0, 0 );
+    p_track->i_timescale = 1;
 }
 
 static void MP4_TrackSelect( demux_t *p_demux, mp4_track_t *p_track, bool b_select )



More information about the vlc-commits mailing list