[vlc-commits] demux: mp4: chunk matching does not need frag flag

Francois Cartegnie git at videolan.org
Mon Oct 31 19:22:50 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 31 18:08:22 2016 +0100| [7416c61d01a42c38699ce93d9ecfd9d8943c68fa] | committer: Francois Cartegnie

demux: mp4: chunk matching does not need frag flag

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index ba2505d..b43c114 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -218,10 +218,9 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     const mp4_chunk_t *p_chunk;
-    if( p_sys->b_fragmented )
-        p_chunk = p_track->cchunk;
-    else
-        p_chunk = &p_track->chunk[p_track->i_chunk];
+
+    p_chunk = ( p_track->cchunk ) ? p_track->cchunk /* DemuxFrg */
+                                  : &p_track->chunk[p_track->i_chunk];
 
     unsigned int i_index = 0;
     unsigned int i_sample = p_track->i_sample - p_chunk->i_sample_first;
@@ -246,7 +245,6 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
     /* now handle elst */
     if( p_track->p_elst )
     {
-        demux_sys_t         *p_sys = p_demux->p_sys;
         MP4_Box_data_elst_t *elst = p_track->BOXDATA(p_elst);
 
         /* convert to offset */
@@ -270,12 +268,10 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
 static inline bool MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_track,
                                          int64_t *pi_delta )
 {
-    demux_sys_t *p_sys = p_demux->p_sys;
+    VLC_UNUSED( p_demux );
     mp4_chunk_t *ck;
-    if( p_sys->b_fragmented )
-        ck = p_track->cchunk;
-    else
-        ck = &p_track->chunk[p_track->i_chunk];
+    ck = ( p_track->cchunk ) ? p_track->cchunk /* DemuxFrg */
+                             : &p_track->chunk[p_track->i_chunk];
 
     unsigned int i_index = 0;
     unsigned int i_sample = p_track->i_sample - ck->i_sample_first;



More information about the vlc-commits mailing list