[dvblast-devel] demux: Fix ECM pid selection.

Georgi Chorbadzhiyski git at videolan.org
Wed Jun 13 11:04:18 CEST 2012


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Mon Jun 11 17:21:40 2012 +0300| [38ef6490a2f0e60d2a7fe9c1d4f3c8f22e8af2b2] | committer: Georgi Chorbadzhiyski

demux: Fix ECM pid selection.

Before this bugfix channels that have CA descriptors listed in
PMT ES loop, on PMT change wrongly unselected some of the PIDs.
The bug was observed on Astra 19" on VH1 channel.

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

 demux.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/demux.c b/demux.c
index a4a2316..e3436f3 100644
--- a/demux.c
+++ b/demux.c
@@ -2255,17 +2255,25 @@ static void HandlePMT( uint16_t i_pid, uint8_t *p_pmt, mtime_t i_dts )
             if ( b_enable_ecm )
             {
                 k = 0;
-                uint16_t f = 0;
-                uint8_t *p_pmt_es;
                 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;
+                    uint16_t f = 0;
+                    uint8_t *p_pmt_es;
+                    int pid_found = 0;
                     while ( (p_pmt_es = pmt_get_es( p_pmt, f++ )) != NULL )
                     {
-                        if ( ca_desc_find( pmtn_get_descs( p_pmt_es ) + DESCS_HEADER_SIZE, descs_get_length( pmtn_get_descs( p_pmt_es ) ), desc09_get_pid( p_desc ) ) == NULL )
-                            UnselectPID( i_sid, desc09_get_pid( p_desc ) );
+                        if ( ca_desc_find( pmtn_get_descs( p_pmt_es ) + DESCS_HEADER_SIZE,
+                                           descs_get_length( pmtn_get_descs( p_pmt_es ) ),
+                                           desc09_get_pid( p_desc ) ) != NULL )
+                        {
+                            pid_found = 1;
+                            break;
+                        }
                     }
+                    if ( !pid_found )
+                        UnselectPID( i_sid, desc09_get_pid( p_desc ) );
                 }
             }
         }



More information about the dvblast-devel mailing list