NIT patches

Mélanie Benoît <[email protected]> Tue, 10 Feb 2015 17:44:07 +0100
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <CAMxPy4yC=fu7nPpuHXs_vFh9YrQtpDhgYgEqQi9EJvn0Nu5bGA@mail.gmail.com>
Hello,

I attached 2 patches for NIT management in libdvbpsi.
Feel free to integrate them.
Regards,

-- 
Mélanie Benoit

_______________________________________________
libdvbpsi-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvbpsi-devel
0001-nit-fix-invalid-documentation.patch (text/x-patch, 3.1 KB)
From 2d22e7103ddb6884b8434c5f6f9f54cd202afdfa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9lanie=20Benoit?= <[email protected]>
Date: Tue, 10 Feb 2015 10:29:18 +0100
Subject: [PATCH 1/3] nit: fix invalid documentation

---
 src/tables/nit.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/tables/nit.h b/src/tables/nit.h
index a518147..9b6e6bc 100644
--- a/src/tables/nit.h
+++ b/src/tables/nit.h
@@ -113,8 +113,8 @@ typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
                               dvbpsi_nit_callback pf_callback, void* p_cb_data)
  * \brief Creation and initialization of a NIT decoder. It is attached to p_dvbpsi.
  * \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
- * \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
- * \param i_extension Table ID extension, here service ID.
+ * \param i_table_id Table ID, 0x40 (actual) or 0x41 (other).
+ * \param i_extension Table ID extension, here network ID.
  * \param pf_callback function to call back on new NIT.
  * \param p_cb_data private data given in argument to the callback.
  * \return true on success, false on failure
@@ -130,8 +130,8 @@ bool dvbpsi_nit_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extens
                              uint16_t i_extension)
  * \brief Destroy a NIT decoder.
  * \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
- * \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
- * \param i_extension Table ID extension, here service ID.
+ * \param i_table_id Table ID, 0x40 (actual) or 0x41 (other).
+ * \param i_extension Table ID extension, here network ID.
  * \return nothing.
  */
 void dvbpsi_nit_detach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
@@ -144,8 +144,8 @@ void dvbpsi_nit_detach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
  * \fn void dvbpsi_nit_init(dvbpsi_nit_t* p_nit, uint8_t i_table_id, uint16_t i_extension,
                             uint16_t i_network_id, uint8_t i_version, bool b_current_next)
  * \brief Initialize a user-allocated dvbpsi_nit_t structure.
- * \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
- * \param i_extension Table ID extension, here service ID.
+ * \param i_table_id Table ID, 0x40 (actual) or 0x41 (other).
+ * \param i_extension Table ID extension, here network ID.
  * \param p_nit pointer to the NIT structure
  * \param i_network_id network id
  * \param i_version NIT version
@@ -160,8 +160,8 @@ void dvbpsi_nit_init(dvbpsi_nit_t* p_nit, uint8_t i_table_id, uint16_t i_extensi
  *                                  uint16_t i_network_id, uint8_t i_version,
  *                                  bool b_current_next);
  * \brief Allocate and initialize a new dvbpsi_nit_t structure.
- * \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
- * \param i_extension Table ID extension, here service ID.
+ * \param i_table_id Table ID, 0x40 (actual) or 0x41 (other)
+ * \param i_extension Table ID extension, here network ID.
  * \param i_network_id network id
  * \param i_version NIT version
  * \param b_current_next current next indicator
-- 
2.2.1
0002-nit-fix-invalid-transport_descriptors_length.patch (text/x-patch, 995 B)
From 568e789d3e8d411b8fe884767a34d56baccc7fce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9lanie=20Benoit?= <[email protected]>
Date: Tue, 10 Feb 2015 11:45:23 +0100
Subject: [PATCH 2/3] nit: fix invalid "transport_descriptors_length"

NIT transport stream is composed of 6 bytes
- ts_id=2B
- network_id=2B
- reserved+ts_descr_loop=2B
---
 src/tables/nit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tables/nit.c b/src/tables/nit.c
index c4bca0b..9522d5f 100644
--- a/src/tables/nit.c
+++ b/src/tables/nit.c
@@ -687,7 +687,7 @@ dvbpsi_psi_section_t* dvbpsi_nit_sections_generate(dvbpsi_t *p_dvbpsi,
             dvbpsi_error(p_dvbpsi, "NIT generator", "unable to carry all the TS descriptors");
 
         /* TS_info_length */
-        i_ts_length = p_current->p_payload_end - p_ts_start - 5;
+        i_ts_length = p_current->p_payload_end - p_ts_start - 6;
         p_ts_start[4] = (i_ts_length >> 8) | 0xf0;
         p_ts_start[5] = i_ts_length;
 
-- 
2.2.1