intf_DbgMsg("Duplicate packet received by TS demux\n");
b_trash = 1;
}
+ else if( p_es_descriptor->i_continuity_counter == 0xFF )
+ {
+ /* This means that the packet is the first one we receive for this
+ ES since the continuity counter ranges between 0 and 0x0F
+ excepts when it has been initialized by the input: Init the
+ counter to the correct value. */
+ intf_DbgMsg("First packet for PID %d received by TS demux\n",
+ p_es_descriptor->i_id);
+ p_es_descriptor->i_continuity_counter = (p[3] & 0x0f);
+ }
else
{
/* This can indicate that we missed a packet or that the
so the PES won't be usefull for any decoder. Moreover,
this should never happen so we can trash the packet and
exit roughly without regrets */
- intf_DbgMsg("PES packet too short: trashed\n");
+ intf_DbgMsg("PES packet is too short: trashed\n");
input_NetlistFreePES( p_input, p_pes );
p_pes = NULL;
/* Stats ?? */
/* Initialise the demux */
p_input->p_es[i_es_loop].p_pes_packet = NULL;
- p_input->p_es[i_es_loop].i_continuity_counter = 0;
+ p_input->p_es[i_es_loop].i_continuity_counter = 0xFF;
p_input->p_es[i_es_loop].b_random = 0;
/* Mark stream to be demultiplexed. */
}
/******************************************************************************
- * AddPgrmDescr: destroy a program descriptor
+ * DestroyPgrmDescr: destroy a program descriptor
******************************************************************************
* All ES descriptions referenced in the descriptor will be deleted.
******************************************************************************/
p_es->i_type = 0; /* ??? */
p_es->b_psi = 0;
p_es->b_pcr = 0;
+ p_es->i_continuity_counter = 0xFF;
p_es->p_pes_packet = NULL;
// p_es->p_next_pes_packet = NULL;
i_es_pid, p_pgrm->i_number );
}
else
- intf_DbgMsg( "Added ES %d not added to the definition of any pgrm\n",
+ intf_DbgMsg( "ES %d not added to the definition of any pgrm\n",
i_es_pid );
}