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 621027 - mpegtsparse problem when parsing EIT and obtaining Transport Stream packet size
mpegtsparse problem when parsing EIT and obtaining Transport Stream packet size
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other All
: Normal major
: 0.10.22
Assigned To: Zaheer Abbas Merali
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-08 21:04 UTC by Karol Sobczak
Modified: 2011-05-09 10:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mpegtspacketizer.c (82.60 KB, text/x-csrc)
2010-06-08 21:04 UTC, Karol Sobczak
  Details
mpegtspacketizer.h (4.78 KB, text/x-chdr)
2010-06-08 21:04 UTC, Karol Sobczak
  Details
fix diff against 10.18 (7.12 KB, patch)
2010-06-23 11:24 UTC, Karol Sobczak
none Details | Review
fix diff against 10.18 (header) (1.14 KB, patch)
2010-06-23 11:24 UTC, Karol Sobczak
none Details | Review
mpegtspacketizer.c patch based on the code in git (722 bytes, patch)
2010-07-16 22:03 UTC, Karol Sobczak
accepted-commit_now Details | Review

Description Karol Sobczak 2010-06-08 21:04:09 UTC
Created attachment 163109 [details]
mpegtspacketizer.c

Hi,

I have found some bugs when using mpegtsparse with DVB-T.

mpegtsparse is not parsing EIT correctly. Some event informations may be lost during parsing. This is because EIT with the same version number may be divided into sections. In that case the packet containing EIT with higher section number, but with the same version number will be discarded (see function "mpegts_packetizer_parse_section_header").

mpegtsparse is not handling seeks correctly. In my case when I was playing MPEG-TS from file and then trying to seek, the mpegtsparse is holding data (not pushing it further). After seek the information about transport stream packet size is lost. Then in function "mpegts_try_discover_packet_size" the packet size is obtained again (when new data in arriving). If the packets at the beginning of "gst_adapter" are invalid, the "mpegts_try_discover_packet_size" would not be able to determine the packet size and the packets at the beginning of the gst_adapter will not be discarded. Therefore all incoming data will be queued in gst_adapter indefinitely.

I have fixed this issues and I am attaching my versions of "mpegtspacketizer.c" and "mpegtspacketizer.h". I was using 10.18 version as code base. In those files I have also added support for TDT tables, but it is already implemented in 10.19 versions of those files.

My fixes are in functions:
mpegts_packetizer_stream_subtable_compare,
mpegts_packetizer_stream_subtable_new,
mpegts_packetizer_parse_section_header,
mpegts_try_discover_packet_size.
and they are quite simple.

Kind regards,
Karol
Comment 1 Karol Sobczak 2010-06-08 21:04:52 UTC
Created attachment 163110 [details]
mpegtspacketizer.h
Comment 2 Karol Sobczak 2010-06-23 11:24:34 UTC
Created attachment 164382 [details] [review]
fix diff against 10.18
Comment 3 Karol Sobczak 2010-06-23 11:24:53 UTC
Created attachment 164383 [details] [review]
fix diff against 10.18 (header)
Comment 4 Zaheer Abbas Merali 2010-06-23 11:37:06 UTC
ok taking a look.
Comment 5 Karol Sobczak 2010-07-16 22:01:56 UTC
I have made patch for mpegtspacketizer.c based on the newest code in git.

What I have fixed:
In function "mpegts_try_discover_packet_size" the MPEG-TS packet size is obtained (when new data in arriving). If the packets at the beginning of "gst_adapter" are invalid, the "mpegts_try_discover_packet_size" would not be able to determine the packet size and the packets at the beginning of the "gst_adapter" instance are not discarded. Therefore all incoming data will be queued in "gst_adapter" instance indefinitely.

My patch discards single packet from the beginning of the "gst_adapter" instance in the case, that the the MPEG-TS packet size cannot be obtained because of invalid packet data.

What was already fixed in the newest git code:
1. The EIT problem is fixed in the newest git code. Now the CRCs of the tables are stored. When the new EIT comes with the same version number and higher section number, it would have different CRC and therefore will not be ignored.
Comment 6 Karol Sobczak 2010-07-16 22:03:34 UTC
Created attachment 166044 [details] [review]
mpegtspacketizer.c patch based on the code in git

My patch discards single packet from the beginning of the "gst_adapter"
instance in the case, that the the MPEG-TS packet size cannot be obtained
because of invalid packet data.
Comment 7 Zaheer Abbas Merali 2011-04-04 10:17:51 UTC
Review of attachment 166044 [details] [review]:

looks good
Comment 8 Zaheer Abbas Merali 2011-04-04 10:31:23 UTC
Seems this was already committed a while back in 0b4dfa68 in January, closing