[vlc-commits] demux: mp4: never match an empty fragment on seek

Francois Cartegnie git at videolan.org
Tue Oct 21 15:38:15 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 21 15:36:47 2014 +0200| [6dfb313050fb29a77d9ee6ba924f0a70a59f74f2] | committer: Francois Cartegnie

demux: mp4: never match an empty fragment on seek

Moov fragment has full length after fixup, but zero data.
Fixes 0 position on ismv seek

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 6867bc2..cd5c70b 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -4280,6 +4280,12 @@ static mp4_fragment_t * GetFragmentByTime( demux_t *p_demux, const mtime_t i_tim
     mtime_t i_base_time = 0;
     while ( p_fragment )
     {
+        if ( p_fragment == &p_demux->p_sys->moovfragment &&
+             p_fragment->i_chunk_range_max_offset == 0 )
+        {
+            p_fragment = p_fragment->p_next;
+            continue;
+        }
         mtime_t i_length = CLOCK_FREQ * p_fragment->i_duration / p_demux->p_sys->i_timescale;
         if ( i_time >= i_base_time &&
              i_time <= i_base_time + i_length )



More information about the vlc-commits mailing list