[MPlayer-dev-eng] [PATCH] demux_mpg: Fix jump/seek regression

Artur Skawina art.08.09 at gmail.com
Sat Nov 19 12:50:42 EET 2016


The probing related change:

 Author: reimar <reimar at b3059339-0415-0410-9bf9-f77b7e298cf2>
 Date:   Sat Feb 20 11:37:20 2016 +0000

    demux_mpg: Limit how much data probing reads.
    
    Limits data read during probe to 4 MB.
    Reading more data can take a long time and also
    causes issues with non-seekable streams that only
    have the cache to seek back in.
    It also increases the chances for false positives.
    It might break autodetection of heavily corrupted
    files, but that seems like a reasonable compromise.
    
    
    git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37760 b3059339-0415-0410-9bf9-f77b7e298cf2

causes playback corruption when demuxing MPEG-PES and jumping
forward.

Not resetting `demuxer->synced`, after it's already set,
makes things work again.


diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c
index a9a967edd154..956723287f2b 100644
--- a/libmpdemux/demux_mpg.c
+++ b/libmpdemux/demux_mpg.c
@@ -690,7 +690,8 @@ static int demux_mpg_probe(demuxer_t *demuxer) {
   off_t tmppos;
   int file_format = DEMUXER_TYPE_UNKNOWN;
 
-  demuxer->synced = -1;
+  if (demuxer->synced==0)
+    demuxer->synced = -1;
   tmppos=stream_tell(demuxer->stream);
   tmp=stream_read_dword(demuxer->stream);
   if(tmp==0x1E0 || tmp==0x1C0) {




More information about the MPlayer-dev-eng mailing list