From 6a611e5d3d822730361ac68f52e0a94c0f7e1fdf Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 3 Jul 2013 18:44:54 +0200 Subject: [PATCH] mpegts: Fix TOT section parsing And use it in example --- gst-libs/gst/mpegts/gst-dvb-section.c | 1 + tests/examples/mpegts/ts-parser.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/gst-libs/gst/mpegts/gst-dvb-section.c b/gst-libs/gst/mpegts/gst-dvb-section.c index 7626caf253..fe3d09f431 100644 --- a/gst-libs/gst/mpegts/gst-dvb-section.c +++ b/gst-libs/gst/mpegts/gst-dvb-section.c @@ -739,6 +739,7 @@ _parse_tot (GstMpegTsSection * section) data = section->data + 8; desc_len = GST_READ_UINT16_BE (data) & 0xFFF; + data += 2; tot->descriptors = gst_mpegts_parse_descriptors (data, desc_len); return tot; diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index f878a90373..db422b3d8a 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -326,6 +326,17 @@ dump_tdt (GstMpegTsSection * section) gst_date_time_unref (date); } +static void +dump_tot (GstMpegTsSection * section) +{ + const GstMpegTsTOT *tot = gst_mpegts_section_get_tot (section); + gchar *str = gst_date_time_to_iso8601_string (tot->utc_time); + + g_printf (" utc_time : %s\n", str); + dump_descriptors (tot->descriptors, 7); + g_free (str); +} + static void dump_section (GstMpegTsSection * section) { @@ -339,6 +350,9 @@ dump_section (GstMpegTsSection * section) case GST_MPEGTS_SECTION_TDT: dump_tdt (section); break; + case GST_MPEGTS_SECTION_TOT: + dump_tot (section); + break; case GST_MPEGTS_SECTION_SDT: dump_sdt (section); break;