[vlc-commits] demux: mp4: don't seek on current position

Francois Cartegnie git at videolan.org
Sat Mar 22 07:22:22 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Mar 19 07:16:58 2014 +0100| [bbd9cc3cac22203ef99c4a7ef870457adf37d64c] | committer: Francois Cartegnie

demux: mp4: don't seek on current position

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 8930f35..45ee4cd 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -733,15 +733,19 @@ static int Demux( demux_t *p_demux )
             if( i_samplessize > 0 )
             {
                 block_t *p_block;
-                int64_t i_delta;
+                int64_t i_delta, i_newpos;
 
                 /* go,go go ! */
-                if( stream_Seek( p_demux->s, MP4_TrackGetPos( tk ) ) )
+                i_newpos = MP4_TrackGetPos( tk );
+                if( stream_Tell( p_demux->s ) != i_newpos )
                 {
-                    msg_Warn( p_demux, "track[0x%x] will be disabled (eof?)",
-                              tk->i_track_ID );
-                    MP4_TrackUnselect( p_demux, tk );
-                    break;
+                    if( stream_Seek( p_demux->s, i_newpos ) )
+                    {
+                        msg_Warn( p_demux, "track[0x%x] will be disabled (eof?)",
+                                  tk->i_track_ID );
+                        MP4_TrackUnselect( p_demux, tk );
+                        break;
+                    }
                 }
 
                 /* now read pes */



More information about the vlc-commits mailing list