Commit 33becfcc authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Paul Saman

fix EIT events dropping

The EIT tables were output incomplete as the
first sections were always dropped.

(2 sections, last_section == 1)
Ex: section 1
    section 0
    secton  1

IsCompleteEIT is always true in first condition in that case.
It is also always true if section is N/N.
first_section > -1 && section_number == last_section because
it has just been added.

Doing the check before effectively adding the section
allows a correct evaluation against current section.
Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 89775135
...@@ -473,6 +473,8 @@ void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_private_ ...@@ -473,6 +473,8 @@ void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_private_
} }
} }
bool b_complete = dvbpsi_IsCompleteEIT(p_eit_decoder, p_section);
/* Add section to EIT */ /* Add section to EIT */
if (!dvbpsi_AddSectionEIT(p_dvbpsi, p_eit_decoder, p_section)) if (!dvbpsi_AddSectionEIT(p_dvbpsi, p_eit_decoder, p_section))
{ {
...@@ -486,7 +488,7 @@ void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_private_ ...@@ -486,7 +488,7 @@ void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_private_
/* FIXME: p_section has just been added to the p_eit_decoder, /* FIXME: p_section has just been added to the p_eit_decoder,
* Why do we have to explicitly check against it in dvbpsi_IsCompleteEIT() ? * Why do we have to explicitly check against it in dvbpsi_IsCompleteEIT() ?
*/ */
if (dvbpsi_IsCompleteEIT(p_eit_decoder, p_section)) if (b_complete)
{ {
assert(p_eit_decoder->pf_eit_callback); assert(p_eit_decoder->pf_eit_callback);
......
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