[dvblast-devel] ecm: Stop dvblast from losing ECM pid on PMT changes.

Georgi Chorbadzhiyski git at videolan.org
Fri Jul 5 10:48:42 CEST 2013


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Fri Jul  5 11:37:43 2013 +0300| [34f232f7e8d1fbe2a2930b597e40fb410c9ac5d6] | committer: Georgi Chorbadzhiyski

ecm: Stop dvblast from losing ECM pid on PMT changes.

The way ECM pids enabling/disabling works leads to condition in which
DVBlast stops streaming ECM pid on PMT changes. Consider the following
PMT updates:

debug: new PMT program=4301 version=8 pcrpid=36
debug:     - desc 0e maximum_bitrate max_bitrate=24894 max_bitrate_decoded=1244700
debug:     - desc 10 smoothing_buffer sb_leak_rate=625 sb_size=1024
debug:     - desc 0b system_clock external_clock_reference_indicator=0 clock_accuracy_integer=2 clock_accuracy_exponent=1
debug:   * ES pid=2160 streamtype=0x02 streamtype_txt="13818-2 video (MPEG-2)"
debug:     - desc 06 data_stream_alignment alignment=2 alignment_txt="Video access unit"
debug:     - desc 09 ca sysid=0xd00 pid=6190
debug:     - desc 09 ca sysid=0x664 pid=7190
debug:   * ES pid=3160 streamtype=0x04 streamtype_txt="13818-3 audio (MPEG-2)"
debug:     - desc 0a audio_language language=eng audiotype=0 audiotype_txt="undefined"
debug:     - desc 09 ca sysid=0xd00 pid=6190
debug:     - desc 09 ca sysid=0x664 pid=7190
debug: end PMT

debug: new PMT program=4301 version=9 pcrpid=2160
debug:     - desc 09 ca sysid=0xd00 pid=6190
debug:     - desc 09 ca sysid=0x664 pid=7190
debug:   * ES pid=2160 streamtype=0x02 streamtype_txt="13818-2 video (MPEG-2)"
debug:     - desc 52 stream_identifier component_tag=1
debug:   * ES pid=3160 streamtype=0x04 streamtype_txt="13818-3 audio (MPEG-2)"
debug:     - desc 52 stream_identifier component_tag=2
debug:     - desc 0a audio_language language=TUR audiotype=1 audiotype_txt="clean effects"
debug:   * ES pid=4040 streamtype=0x05 streamtype_txt="13818-1 private sections"
debug:     - desc 52 stream_identifier component_tag=4
debug:     - desc 0f private_data_indicator private_indicator=0x4f545600
debug:     - desc fe unknown length=4 value=45545634
debug:     - desc 90 unknown length=1 value=90
debug: end PMT

The first one enables ECM pids 6190 and 7190. The second one causes DVBlast
to stop streaming these PIDs because they are not mentioned in ES descriptor
loop.

This patch fixes this behaviour.

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

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

diff --git a/demux.c b/demux.c
index 78c0fed..173f734 100644
--- a/demux.c
+++ b/demux.c
@@ -2367,6 +2367,22 @@ static void HandlePMT( uint16_t i_pid, uint8_t *p_pmt, mtime_t i_dts )
                             pid_found = 1;
                             break;
                         }
+                        if ( !pid_found )
+                        {
+                            /* Check if PID is described in the global PMT descriptors */
+                            int r = 0;
+                            uint8_t *p_g_desc;
+                            while ( (p_g_desc = descs_get_desc( pmt_get_descs( p_sid->p_current_pmt ), r++ )) != NULL)
+                            {
+                                if ( desc_get_tag( p_g_desc ) != 0x09 || !desc09_validate( p_g_desc ) )
+                                    continue;
+                                if ( ca_desc_find( pmt_get_descs( p_pmt ) + DESCS_HEADER_SIZE, descs_get_length( pmt_get_descs( p_pmt ) ), 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