[vlc-commits] demux: mp4: read samples duration from trex

Francois Cartegnie git at videolan.org
Mon Apr 14 21:17:47 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Apr 14 20:30:19 2014 +0200| [64dddc7905aac1f3ee5cc88c566088a9897ffaa7] | committer: Francois Cartegnie

demux: mp4: read samples duration from trex

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

 modules/demux/mp4/mp4.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index bb72782..71e9d58 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3708,7 +3708,15 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
      * more than one subsegment. */
     if( !default_duration )
     {
-        if( p_sidx )
+        MP4_Box_t *p_trex = MP4_BoxGet( p_demux->p_sys->p_root, "moov/mvex/trex");
+        if ( p_trex )
+        {
+            while( p_trex && p_trex->data.p_trex->i_track_ID != i_track_ID )
+                p_trex = p_trex->p_next;
+            if ( p_trex )
+                default_duration = p_trex->data.p_trex->i_default_sample_duration * p_track->i_timescale;
+        }
+        else if( p_sidx )
         {
             MP4_Box_data_sidx_t *p_sidx_data = p_sidx->data.p_sidx;
             assert( p_sidx_data->i_reference_count == 1 );



More information about the vlc-commits mailing list