GNOME Bugzilla – Bug 483400
mpegtsparse: PAT with version 0 incorrectly skipped by parser
Last modified: 2007-10-05 08:06:02 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.
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.
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.