Web lists-archives.com

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

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

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;
   if(tmp==0x1E0 || tmp==0x1C0) {

MPlayer-dev-eng mailing list