Commit 97c37e90 authored by massiot's avatar massiot

* demux.c: Fix invalid CAPMTs when unselecting programs, patch by Marian Ďurkovič.


git-svn-id: svn://svn.videolan.org/dvblast/trunk@42 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent 310a97e3
......@@ -332,6 +332,24 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
GetPIDS( &pi_current_pids, &i_nb_current_pids, p_output->i_sid,
p_output->pi_pids, p_output->i_nb_pids );
if ( i_old_sid && i_old_sid != i_sid )
{
p_output->i_sid = i_sid;
for ( i = 0; i < i_nb_sids; i++ )
{
if ( pp_sids[i]->i_sid == i_old_sid )
{
UnsetPID( pp_sids[i]->i_pmt_pid );
if ( i_ca_handle && !SIDIsSelected( i_old_sid )
&& pp_sids[i]->p_current_pmt != NULL
&& PMTNeedsDescrambling( pp_sids[i]->p_current_pmt ) )
en50221_DeletePMT( pp_sids[i]->p_current_pmt );
break;
}
}
}
for ( i = 0; i < i_nb_current_pids; i++ )
{
if ( pi_current_pids[i] != EMPTY_PID &&
......@@ -354,8 +372,9 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
free( pi_wanted_pids );
free( pi_current_pids );
if ( i_sid && p_output->i_sid != i_sid )
if ( i_sid && i_sid != i_old_sid )
{
p_output->i_sid = i_old_sid;
for ( i = 0; i < i_nb_sids; i++ )
{
if ( pp_sids[i]->i_sid == i_sid )
......@@ -381,23 +400,6 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
memcpy( p_output->pi_pids, pi_pids, sizeof(uint16_t) * i_nb_pids );
p_output->i_nb_pids = i_nb_pids;
if ( i_old_sid && i_old_sid != i_sid )
{
for ( i = 0; i < i_nb_sids; i++ )
{
if ( pp_sids[i]->i_sid == i_old_sid )
{
UnsetPID( pp_sids[i]->i_pmt_pid );
if ( i_ca_handle && !SIDIsSelected( i_old_sid )
&& pp_sids[i]->p_current_pmt != NULL
&& PMTNeedsDescrambling( pp_sids[i]->p_current_pmt ) )
en50221_DeletePMT( pp_sids[i]->p_current_pmt );
break;
}
}
}
if ( i_sid != i_old_sid )
{
NewPAT( p_output );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment