[PATCH] demux_mpg: Fix jump/seek regression

Artur Skawina <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
The probing related change:

 Author: reimar <reimar@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) {


_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.