From b11f737096b34cd911d06489fd988289c5c38981 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Fri, 19 Nov 2010 17:25:01 +0100 Subject: [PATCH] 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. --- gst/mpegdemux/mpegtspacketizer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index e8ce7b3c57..3cad7da7a3 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 ();