Commit 1e0d8c90 authored by Benoit Steiner's avatar Benoit Steiner

Le continuity_counter du vlc est maintenant initialise automatiquement a
la valeur du premier paquet TS que l'input recoit pour chaque PID. On
evite de trasher systematiquement (ou presque) le premier TS de chaque
PID.
parent 07877678
...@@ -705,6 +705,16 @@ static __inline__ void input_DemuxTS( input_thread_t *p_input, ...@@ -705,6 +705,16 @@ static __inline__ void input_DemuxTS( input_thread_t *p_input,
intf_DbgMsg("Duplicate packet received by TS demux\n"); intf_DbgMsg("Duplicate packet received by TS demux\n");
b_trash = 1; 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 else
{ {
/* This can indicate that we missed a packet or that the /* This can indicate that we missed a packet or that the
...@@ -831,7 +841,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input, ...@@ -831,7 +841,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
so the PES won't be usefull for any decoder. Moreover, so the PES won't be usefull for any decoder. Moreover,
this should never happen so we can trash the packet and this should never happen so we can trash the packet and
exit roughly without regrets */ 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 ); input_NetlistFreePES( p_input, p_pes );
p_pes = NULL; p_pes = NULL;
/* Stats ?? */ /* Stats ?? */
......
...@@ -135,7 +135,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id ) ...@@ -135,7 +135,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
/* Initialise the demux */ /* Initialise the demux */
p_input->p_es[i_es_loop].p_pes_packet = NULL; 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; p_input->p_es[i_es_loop].b_random = 0;
/* Mark stream to be demultiplexed. */ /* Mark stream to be demultiplexed. */
......
...@@ -1167,7 +1167,7 @@ static pgrm_descriptor_t* AddPgrmDescr( stream_descriptor_t* p_stream, ...@@ -1167,7 +1167,7 @@ static pgrm_descriptor_t* AddPgrmDescr( stream_descriptor_t* p_stream,
} }
/****************************************************************************** /******************************************************************************
* AddPgrmDescr: destroy a program descriptor * DestroyPgrmDescr: destroy a program descriptor
****************************************************************************** ******************************************************************************
* All ES descriptions referenced in the descriptor will be deleted. * All ES descriptions referenced in the descriptor will be deleted.
******************************************************************************/ ******************************************************************************/
...@@ -1253,6 +1253,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input, ...@@ -1253,6 +1253,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input,
p_es->i_type = 0; /* ??? */ p_es->i_type = 0; /* ??? */
p_es->b_psi = 0; p_es->b_psi = 0;
p_es->b_pcr = 0; p_es->b_pcr = 0;
p_es->i_continuity_counter = 0xFF;
p_es->p_pes_packet = NULL; p_es->p_pes_packet = NULL;
// p_es->p_next_pes_packet = NULL; // p_es->p_next_pes_packet = NULL;
...@@ -1269,7 +1270,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input, ...@@ -1269,7 +1270,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input,
i_es_pid, p_pgrm->i_number ); i_es_pid, p_pgrm->i_number );
} }
else 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 ); i_es_pid );
} }
......
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