GNOME Bugzilla – Bug 635281
[mpegtsparse] TDT packets are only parsed for odd hours
Last modified: 2010-11-23 10:32:10 UTC
I have found a very strange bug in mpegtsparse for TDT packets, which are only parsed for odd hours :/ It results that TDT and TOT sections doesn't have the same structure as other sections and the packetizer is not parsing them properly. The hour bit of the TDT table is the current_next_indicator bit for the other sections, invalidating the TDT tables for even hours. mpegtsparse: fix handling of TOT and TDT sections TDT and TOT sections, with PID=0x14, doesn't extend to several packets and the section filter is not needed here and shouldn't be used at all for these tables because the have a different structure. For example, TDT tables were not parsed for odd hours because this bit is the 'current_next_indicator' bit for the other sections, and the table was discarded. mpegtsparse: don't calculate the CRC for TOT tables TOT tables, with table_id=0x73, don't have a CRC, so don't calcute it
Created attachment 174857 [details] [review] don't calculate the CRC for TOT tables
Created attachment 174859 [details] [review] fix handling of TOT and TDT sections
commit b11f737096b34cd911d06489fd988289c5c38981 Author: Andoni Morales Alastruey <amorales@flumotion.com> Date: Fri Nov 19 17:25:01 2010 +0100 mpegtsparse: fix handling of TOT and TDT sections. Fixes #635281. TDT and TOT sections, with PID=0x14, doesn't extend to several packets and the section filter is not needed here and shouldn't be used at all for these tables because the have a different structure. For example, TDT tables were not parsed for odd hours because this bit is the 'current_next_indicator' bit for the other sections, and the table was discarded. commit 2611b12970d2c2254ecc3f0a6f02a09ffa82a16a Author: Andoni Morales Alastruey <amorales@flumotion.com> Date: Fri Nov 19 17:22:06 2010 +0100 mpegtsparse: don't calculate the CRC for TOT tables. Fixes #635281. TOT tables, with table_id=0x73, don't have a CRC, so don't calcute it
Created attachment 174865 [details] [review] Fix mistake in previous patch Fixes a stupid mistake in previous patch
Created attachment 175019 [details] [review] Create sub buffer with the section length Just one thing missing in the previous patches. The sub buffer of the section must have the size of the section: 8+1+1+2+12+40 (in bits), so we can't reuse the first sub buffer created with the payload of the TS packet and we neeed to create a new one with 3 + section_length bytes.
I committed the last two patches, thanks!