Commit ef2ef6d2 authored by Christophe Massiot's avatar Christophe Massiot

* src/tables/eit.c: Simplify EIT table completion (thanks Johann).

parent 4899809e
...@@ -419,20 +419,22 @@ void dvbpsi_GatherEITSections(dvbpsi_decoder_t * p_psi_decoder, ...@@ -419,20 +419,22 @@ void dvbpsi_GatherEITSections(dvbpsi_decoder_t * p_psi_decoder,
/* Check if we have all the sections */ /* Check if we have all the sections */
b_complete = 0; b_complete = 0;
for(i = 0; i <= p_eit_decoder->i_last_section_number; i++)
{
if(!p_eit_decoder->ap_sections[i])
break;
if(i == p_eit_decoder->i_last_section_number)
b_complete = 1;
}
/* As there may be gaps in the section_number fields (see below), we /* As there may be gaps in the section_number fields (see below), we
* have to wait until we have received a section_number twice - this * have to wait until we have received a section_number twice or
* is the only way to be sure that a complete table has been sent! */ * until we have a received a section_number which is
if(!b_complete && * first_received_section_number - 1;
p_section->i_number == p_eit_decoder->i_first_received_section_number) * if the first_received_section_number is 0, it's enough to wait
* until the last_section_number has been received;
* this is the only way to be sure that a complete table has been
* sent! */
if((p_eit_decoder->i_first_received_section_number > 0 &&
(p_section->i_number ==
p_eit_decoder->i_first_received_section_number ||
p_section->i_number ==
p_eit_decoder->i_first_received_section_number - 1)) ||
(p_eit_decoder->i_first_received_section_number == 0 &&
p_section->i_number == p_eit_decoder->i_last_section_number))
{ {
for(i = 0; i <= p_eit_decoder->i_last_section_number; i++) for(i = 0; i <= p_eit_decoder->i_last_section_number; i++)
{ {
......
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