Commit 63d5c0cb authored by Marian Durkovic's avatar Marian Durkovic

Avoid empty SI tables and always deliver valid ones.

parent 57393efc
......@@ -248,19 +248,10 @@ void dvbpsi_GatherCATSections(dvbpsi_decoder_t* p_decoder,
else
{
if( (p_cat_decoder->b_current_valid)
&& (p_cat_decoder->current_cat.i_version == p_section->i_version))
&& (p_cat_decoder->current_cat.i_version == p_section->i_version)
&& (p_cat_decoder->current_cat.b_current_next ==
p_section->b_current_next))
{
/* Signal a new CAT if the previous one wasn't active */
if( (!p_cat_decoder->current_cat.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_cat_t* p_cat = (dvbpsi_cat_t*)malloc(sizeof(dvbpsi_cat_t));
p_cat_decoder->current_cat.b_current_next = 1;
*p_cat = p_cat_decoder->current_cat;
p_cat_decoder->pf_callback(p_cat_decoder->p_cb_data, p_cat);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -28,11 +28,8 @@
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the CAT decoder and the CAT generator.
*
* Application interface for the CAT decoder and the CAT generator. New
* decoded CAT tables are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the two lists are empty and should be
* caught from the previous structure.
* Application interface for the CAT decoder and the CAT generator.
* New decoded CAT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_CAT_H_
......
......@@ -342,19 +342,10 @@ void dvbpsi_GatherEITSections(dvbpsi_decoder_t * p_psi_decoder,
else
{
if( (p_eit_decoder->b_current_valid)
&& (p_eit_decoder->current_eit.i_version == p_section->i_version))
&& (p_eit_decoder->current_eit.i_version == p_section->i_version)
&& (p_eit_decoder->current_eit.b_current_next ==
p_section->b_current_next))
{
/* Signal a new EIT if the previous one wasn't active */
if( (!p_eit_decoder->current_eit.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_eit_t* p_eit = (dvbpsi_eit_t*)malloc(sizeof(dvbpsi_eit_t));
p_eit_decoder->current_eit.b_current_next = 1;
*p_eit = p_eit_decoder->current_eit;
p_eit_decoder->pf_callback(p_eit_decoder->p_cb_data, p_eit);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -26,11 +26,8 @@
* \author Christophe Massiot <massiot@via.ecp.fr>
* \brief Application interface for the EIT decoder and the EIT generator.
*
* Application interface for the EIT decoder and the EIT generator. New
* decoded EIT are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the event information list is empty and should
* be caught from the previous structure.
* Application interface for the EIT decoder and the EIT generator.
* New decoded EIT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_EIT_H_
......
......@@ -375,19 +375,10 @@ void dvbpsi_GatherNITSections(dvbpsi_decoder_t * p_decoder,
else
{
if( (p_nit_decoder->b_current_valid)
&& (p_nit_decoder->current_nit.i_version == p_section->i_version))
&& (p_nit_decoder->current_nit.i_version == p_section->i_version)
&& (p_nit_decoder->current_nit.b_current_next ==
p_section->b_current_next))
{
/* Signal a new NIT if the previous one wasn't active */
if( (!p_nit_decoder->current_nit.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_nit_t* p_nit = (dvbpsi_nit_t*)malloc(sizeof(dvbpsi_nit_t));
p_nit_decoder->current_nit.b_current_next = 1;
*p_nit = p_nit_decoder->current_nit;
p_nit_decoder->pf_callback(p_nit_decoder->p_cb_data, p_nit);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -28,11 +28,8 @@
* \author Johann Hanne
* \brief Application interface for the NIT decoder and the NIT generator.
*
* Application interface for the NIT decoder and the NIT generator. New
* decoded NIT tables are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the two lists are empty and should be
* caught from the previous structure.
* Application interface for the NIT decoder and the NIT generator.
* New decoded NIT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_NIT_H_
......
......@@ -265,19 +265,10 @@ void dvbpsi_GatherPATSections(dvbpsi_decoder_t* p_decoder,
else
{
if( (p_pat_decoder->b_current_valid)
&& (p_pat_decoder->current_pat.i_version == p_section->i_version))
&& (p_pat_decoder->current_pat.i_version == p_section->i_version)
&& (p_pat_decoder->current_pat.b_current_next ==
p_section->b_current_next))
{
/* Signal a new PAT if the previous one wasn't active */
if( (!p_pat_decoder->current_pat.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_pat_t* p_pat = (dvbpsi_pat_t*)malloc(sizeof(dvbpsi_pat_t));
p_pat_decoder->current_pat.b_current_next = 1;
*p_pat = p_pat_decoder->current_pat;
p_pat_decoder->pf_callback(p_pat_decoder->p_cb_data, p_pat);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -26,11 +26,8 @@
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the PAT decoder and the PAT generator.
*
* Application interface for the PAT decoder and the PAT generator. New
* decoded PAT tables are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the program list is empty and should be
* caught from the previous structure.
* Application interface for the PAT decoder and the PAT generator.
* New decoded PAT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_PAT_H_
......
......@@ -338,19 +338,10 @@ void dvbpsi_GatherPMTSections(dvbpsi_decoder_t* p_decoder,
else
{
if( (p_pmt_decoder->b_current_valid)
&& (p_pmt_decoder->current_pmt.i_version == p_section->i_version))
&& (p_pmt_decoder->current_pmt.i_version == p_section->i_version)
&& (p_pmt_decoder->current_pmt.b_current_next ==
p_section->b_current_next))
{
/* Signal a new PMT if the previous one wasn't active */
if( (!p_pmt_decoder->current_pmt.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_pmt_t* p_pmt = (dvbpsi_pmt_t*)malloc(sizeof(dvbpsi_pmt_t));
p_pmt_decoder->current_pmt.b_current_next = 1;
*p_pmt = p_pmt_decoder->current_pmt;
p_pmt_decoder->pf_callback(p_pmt_decoder->p_cb_data, p_pmt);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -26,11 +26,8 @@
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the PMT decoder and the PMT generator.
*
* Application interface for the PMT decoder and the PMT generator. New
* decoded PMT tables are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the two lists are empty and should be
* caught from the previous structure.
* Application interface for the PMT decoder and the PMT generator.
* New decoded PMT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_PMT_H_
......
......@@ -339,19 +339,10 @@ void dvbpsi_GatherSDTSections(dvbpsi_decoder_t * p_psi_decoder,
else
{
if( (p_sdt_decoder->b_current_valid)
&& (p_sdt_decoder->current_sdt.i_version == p_section->i_version))
&& (p_sdt_decoder->current_sdt.i_version == p_section->i_version)
&& (p_sdt_decoder->current_sdt.b_current_next ==
p_section->b_current_next))
{
/* Signal a new SDT if the previous one wasn't active */
if( (!p_sdt_decoder->current_sdt.b_current_next)
&& (p_section->b_current_next))
{
dvbpsi_sdt_t * p_sdt = (dvbpsi_sdt_t*)malloc(sizeof(dvbpsi_sdt_t));
p_sdt_decoder->current_sdt.b_current_next = 1;
*p_sdt = p_sdt_decoder->current_sdt;
p_sdt_decoder->pf_callback(p_sdt_decoder->p_cb_data, p_sdt);
}
/* Don't decode since this version is already decoded */
b_append = 0;
}
......
......@@ -26,11 +26,8 @@
* \author Johan Bilien <jobi@via.ecp.fr>
* \brief Application interface for the SDT decoder and the SDT generator.
*
* Application interface for the SDT decoder and the SDT generator. New
* decoded SDT are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the service description list is empty and should
* be caught from the previous structure.
* Application interface for the SDT decoder and the SDT generator.
* New decoded SDT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_SDT_H_
......
......@@ -28,11 +28,8 @@
* \author Johann Hanne
* \brief Application interface for the TDT/TOT decoder and the TDT/TOT generator.
*
* Application interface for the TDT/TOT decoder and the TDT/TOT generator. New
* decoded TDT/TOT tables are sent by callback to the application. If a table
* wasn't active (b_current_next == 0) and the next is the same but active
* (b_current_next == 1) then the two lists are empty and should be
* caught from the previous structure.
* Application interface for the TDT/TOT decoder and the TDT/TOT generator.
* New decoded TDT/TOT tables are sent by callback to the application.
*/
#ifndef _DVBPSI_TOT_H_
......
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