From 4632ccd5bee5060fbca72d76df77d2abe182d47e Mon Sep 17 00:00:00 2001 From: Jesper Larsen Date: Mon, 28 Oct 2013 14:26:39 +0100 Subject: [PATCH] mpegts: Add network_id to GstMpegTsNIT The network_id is stored in the subtable extension. Make a field in the GstMpegTsNIT for better code readability --- gst-libs/gst/mpegts/gst-dvb-section.c | 3 ++- gst-libs/gst/mpegts/gst-dvb-section.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/mpegts/gst-dvb-section.c b/gst-libs/gst/mpegts/gst-dvb-section.c index 0d9b203fa0..323d18759f 100644 --- a/gst-libs/gst/mpegts/gst-dvb-section.c +++ b/gst-libs/gst/mpegts/gst-dvb-section.c @@ -489,7 +489,8 @@ _parse_nit (GstMpegTsSection * section) data = section->data; end = data + section->section_length; - /* Skip already parsed data */ + /* Set network id, and skip the rest of what is already parsed */ + nit->network_id = section->subtable_extension; data += 8; nit->actual_network = section->table_id == 0x40; diff --git a/gst-libs/gst/mpegts/gst-dvb-section.h b/gst-libs/gst/mpegts/gst-dvb-section.h index 46883327b8..a3d1969054 100644 --- a/gst-libs/gst/mpegts/gst-dvb-section.h +++ b/gst-libs/gst/mpegts/gst-dvb-section.h @@ -145,17 +145,17 @@ struct _GstMpegTsNITStream /** * GstMpegTsNIT: * @actual_network: Whether this NIT corresponds to the actual stream + * @network_id: ID of the network that this NIT describes * @descriptors: (element-type GstMpegTsDescriptor): the global descriptors * @streams: (element-type GstMpegTsNITStream): the streams * * Network Information Table (ISO/IEC 13818-1 / EN 300 468) * - * The network_id is contained in the subtable_extension field of the - * container #GstMpegTsSection. */ struct _GstMpegTsNIT { gboolean actual_network; + guint16 network_id; GPtrArray *descriptors;