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 483400 - mpegtsparse: PAT with version 0 incorrectly skipped by parser
mpegtsparse: PAT with version 0 incorrectly skipped by parser
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-04 15:48 UTC by Wai-Ming Ho
Modified: 2007-10-05 08:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch mpegtspacketizer.c to initialize version_number to NOTSET (1.75 KB, patch)
2007-10-04 16:20 UTC, Wai-Ming Ho
committed Details | Review

Description Wai-Ming Ho 2007-10-04 15:48:01 UTC
When the MPEG TS stream contains a PAT whose version number (see ISO 13818-1, section 2.4.4.4) is 0, mpegtsparse completely skips the PAT parsing and no sink pads are created for the selected program. This results in pipeline starvation as none of the MPEG TS packet is pushed downstream.
Comment 1 Wai-Ming Ho 2007-10-04 16:20:43 UTC
Created attachment 96646 [details] [review]
Patch mpegtspacketizer.c to initialize version_number to NOTSET

The patch sets the member section_version_number to an invalid version number when the structure is first created. This allows PAT version 0 to be treated as a new version when it is seen for the first time. This behavior will ensure that mpegtspacketizer will process a version 0 PAT when it starts up for the first time.

The patch also includes a review on mpegtsparse.c:720: We really should be comparing (--patcount > 0) rather than (patcount-- == 1). This ensures that values above 0 to be referenced programs. The pre-increment is required because otherwise, we never remove any unreferenced programs as the old value of patcount is used for the comparison.
Comment 2 Sebastian Dröge (slomo) 2007-10-05 08:06:02 UTC
2007-10-05  Sebastian Dröge  <slomo@circular-chaos.org>

        Patch by: Wai-Ming Ho <webregbox at yahoo dot co dot uk>

        * gst/mpegtsparse/mpegtspacketizer.c:
        (mpegts_packetizer_stream_new):
        Don't skip PAT with version number 0. Fixes #483400.
        * gst/mpegtsparse/mpegtsparse.c: (mpegts_parse_apply_pat):
        Make all values above 0 mark a referenced program as they can be
        incremented and only 1 had marked a referenced program before, causing
        actually referenced programs to be unreferenced.