[dvblast-devel] Add ECM PIDs from PID descriptors to new services

Christophe Massiot git at videolan.org
Fri Mar 11 17:02:26 CET 2016


dvblast | branch: master | Christophe Massiot <cmassiot at openheadend.tv> | Tue Mar  8 16:47:00 2016 +0100| [446507480162eaeb185c6ac124810a6fe972b798] | committer: Christophe Massiot

Add ECM PIDs from PID descriptors to new services

Patch courtesy of Daniel Kucera.

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=446507480162eaeb185c6ac124810a6fe972b798
---

 demux.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/demux.c b/demux.c
index 7784f1e..7aeeafc 100644
--- a/demux.c
+++ b/demux.c
@@ -1104,6 +1104,7 @@ static void GetPIDS( uint16_t **ppi_wanted_pids, int *pi_nb_wanted_pids,
     uint16_t i_pmt_pid, i_pcr_pid;
     uint8_t *p_es;
     uint8_t j;
+    const uint8_t *p_desc;
 
     if ( i_nb_pids || i_sid == 0 )
     {
@@ -1138,9 +1139,22 @@ static void GetPIDS( uint16_t **ppi_wanted_pids, int *pi_nb_wanted_pids,
                                   (*pi_nb_wanted_pids + 1) * sizeof(uint16_t) );
             (*ppi_wanted_pids)[(*pi_nb_wanted_pids)++] = pmtn_get_pid( p_es );
         }
+
+        if ( b_enable_ecm )
+        {
+            uint8_t k = 0;
+
+            while ((p_desc = descs_get_desc( pmtn_get_descs( p_es ), k++ )) != NULL)
+            {
+                if ( desc_get_tag( p_desc ) != 0x09 || !desc09_validate( p_desc ) )
+                    continue;
+                *ppi_wanted_pids = realloc( *ppi_wanted_pids,
+                                      (*pi_nb_wanted_pids + 1) * sizeof(uint16_t) );
+                (*ppi_wanted_pids)[(*pi_nb_wanted_pids)++] =  desc09_get_pid( p_desc );
+            }
+        }
     }
 
-    const uint8_t *p_desc;
 
     if ( b_enable_ecm )
     {



More information about the dvblast-devel mailing list