[vlc-commits] demux: mp4: don't trust only timescale for rate

Francois Cartegnie git at videolan.org
Mon May 26 22:02:01 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 26 20:31:50 2014 +0200| [8a83c71cb032dcba963f12694cf0ac51e10eb4a1] | committer: Francois Cartegnie

demux: mp4: don't trust only timescale for rate

wrong fix was 198bb199366ce6d0320fb5fca64784abec58c65f

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 9a05359..6ce09b0 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1918,8 +1918,10 @@ static void TrackGetESSampleRate( demux_t *p_demux,
     MP4_Box_t *p_mdhd = MP4_BoxGet( p_trak, "mdia/mdhd" );
     if ( p_mdhd )
     {
-        *pi_num = BOXDATA(p_mdhd)->i_timescale / 1000;
-        *pi_den = 1;
+        vlc_ureduce( pi_num, pi_den,
+                     BOXDATA(p_mdhd)->i_timescale * p_track->i_sample_count,
+                     BOXDATA(p_mdhd)->i_duration,
+                     UINT16_MAX);
         return;
     }
 



More information about the vlc-commits mailing list