summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <amorales@flumotion.com>2010-11-19 17:25:01 +0100
committerAlessandro Decina <alessandro.d@gmail.com>2010-11-19 18:11:50 +0100
commitb11f737096b34cd911d06489fd988289c5c38981 (patch)
treefe424ad0835d66a04eb0514d819a41bd7dc0a3be
parent2611b12970d2c2254ecc3f0a6f02a09ffa82a16a (diff)
downloadgstreamer-plugins-bad-b11f737096b34cd911d06489fd988289c5c38981.tar.gz
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.
-rw-r--r--gst/mpegdemux/mpegtspacketizer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c
index e8ce7b3c5..3cad7da7a 100644
--- a/gst/mpegdemux/mpegtspacketizer.c
+++ b/gst/mpegdemux/mpegtspacketizer.c
@@ -2197,6 +2197,21 @@ mpegts_packetizer_push_section (MpegTSPacketizer * packetizer,
sub_buf = gst_buffer_create_sub (packet->buffer,
data - GST_BUFFER_DATA (packet->buffer), packet->data_end - data);
+ /* TDT and TOT sections (see ETSI EN 300 468 5.2.5)
+ * these sections do not extend to several packets so we don't need to use the
+ * sections filter. */
+ if (packet->pid == 0x14) {
+ table_id = *data++;
+ section->section_length = GST_READ_UINT16_BE (data) & 0x0FFF;
+ section->buffer = sub_buf;
+ section->table_id = table_id;
+ section->complete = TRUE;
+ res = TRUE;
+ GST_DEBUG ("TDT section pid:%d table_id:%d section_length: %d\n",
+ packet->pid, table_id, section_length);
+ goto out;
+ }
+
stream = packetizer->streams[packet->pid];
if (stream == NULL) {
stream = mpegts_packetizer_stream_new ();