After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615470 - mpegtsdemux falling off the end of buffers/corrupting stream
mpegtsdemux falling off the end of buffers/corrupting stream
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-11 19:24 UTC by xiphmont
Modified: 2010-10-04 18:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description xiphmont 2010-04-11 19:24:00 UTC
an MPEG-TS stream consists of 188 byte chunks.  As default buffer size is 4096 bytes, the mpegtsdemux element is fed buffers containing fractional numbers of
unaligned MPEG-TS frames, which it apparently can't always cope with.  Among the symptoms, it reports "skipping, adaptation_field consumed all data", and drops some portion in the middle of the stream.  This badly garbles the content it is demuxing.  Forcing, eg, the hdv1394src to hand back buffers that are always integral multiples of 188 bytes avoids the behavior.  

Specifically the following script does not [always] work:

gst-launch \
	   hdv1394src \
             ! queue \
             ! mpegtsdemux \
             ! queue \
             ! mpeg2dec \
	     ! xvimagesink sync=false

The following change reliably eliminates the problem:

	   hdv1394src blocksize="4136" \
 
Unfortunately, the incorrect behavior has some timing component.  On (eg) an old dual core Thinkpad T61, the video reliably corrupts badly.  On a newer i7 quad-core, the problem doesn't seem to occur.

On the machine[s] where the blocksize change is needed to prevent HDV corruption, no other HDV application (eg, dvgrab) shows any trobule, nor has there ever been an observed failure using the forced blocksize with hdv1394src.
Comment 1 Edward Hervey 2010-10-04 18:36:10 UTC
Been trying to reproduce this under various conditions with a lot of stressing applied (reduced queues, 800MHz cores, ...) ... and I just can't reproduce it anymore.

It was most likely fixed by the following commit, I'm therefore closing the bug. Please re-open if you can reproduce with latest -good.

commit 5208d030b3354101c5c0a49a0758c9782f0da116
Author: Zaheer Abbas Merali <zaheerabbas@merali.org>
Date:   Mon May 17 16:26:03 2010 +0100

    mpegtsdemux: fix memory corruption when parsing adaptation field