[MPlayer-dev-eng] [PATCH] Continue playing Real-format streams after errors

Pekka Enberg Pekka.Enberg at cs.helsinki.fi
Thu Aug 7 22:42:26 CEST 2003


Hi,

I get the following error at random intervals (sometimes within a minute of
starting to play the stream, sometimes after ten to fifteen minutes) when
watching AssemblyTV [1] Real-format stream:

******** !!!!!!!! BUG!! len=-194 !!!!!!!!!!! ********

I traced the problem to demux_real_fill_buffer() in libmpdemux/demux_real.c.
For whatever reason, vpkg_length gets value greater than len leading to
negative value of len. This confuses MPlayer so much that the video streaming
effectively stops.

The patch allows MPlayer to continue playing the video stream. However, the
audio stream is always skipping badly after the bug is triggered (it doesn't
restore to normal either).

I'm running Red Hat Linux 8.0 on AMD Athlon. The patch is against
MPlayer-current of today.

P.S. Please cc me as I'm not subscribed to the list.

  1. http://www.assemblytv.net/

-Pekka

diff -urN MPlayer-20030807/libmpdemux/demux_real.c MPlayer-real-stream-fix/libmpdemux/demux_real.c
--- MPlayer-20030807/libmpdemux/demux_real.c	2003-08-02 21:45:24.000000000 +0300
+++ MPlayer-real-stream-fix/libmpdemux/demux_real.c	2003-08-07 23:19:46.000000000 +0300
@@ -654,6 +654,15 @@
 		    break;
 		}
 		// whole packet (not fragmented):
+		if (vpkg_length > len) {
+		    printf("\n******** WARNING: vpkg_length=%i > len=%i ********\n", vpkg_length, len);
+		    /*
+		     * To keep the video stream rolling, we need to break 
+		     * here. We shouldn't touch len to make sure rest of the
+		     * broken packet is skipped.
+		     */
+		    break;
+		}
 		dp_hdr->len=vpkg_length; len-=vpkg_length;
 		stream_read(demuxer->stream, dp_data, vpkg_length);
 		dp->pts=(dp_hdr->len<3)?0:





More information about the MPlayer-dev-eng mailing list