Commit c1d884e6 authored by Jean-Paul Saman's avatar Jean-Paul Saman

PSI tables (DVB,ATSC): cleanup dvbpsi_*Gather functions.

Cleanup dvbpsi_*_Gather*Sections() function to not call dvbpsi_DeleteSections() twice.
The function dvbpsi_decoder_reset() already does that, so there is no need to do it
inside the gather functions when dvbpsi_ReInit*() is called.
parent c1e330b7
......@@ -476,14 +476,12 @@ static void dvbpsi_atsc_GatherEITSections(dvbpsi_t * p_dvbpsi,
/* Decode the sections */
dvbpsi_atsc_DecodeEITSections(p_eit_decoder->p_building_eit,
p_eit_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_eit_decoder->p_sections);
p_eit_decoder->p_sections = NULL;
/* signal the new EIT */
p_eit_decoder->pf_eit_callback(p_eit_decoder->p_cb_data,
p_eit_decoder->p_building_eit);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitEIT(p_eit_decoder, false);
assert(p_eit_decoder->p_sections == NULL);
}
}
......
......@@ -391,16 +391,13 @@ static void dvbpsi_atsc_GatherETTSections(dvbpsi_t* p_dvbpsi,
/* Decode the sections */
dvbpsi_atsc_DecodeETTSections(p_ett_decoder->p_building_ett,
p_ett_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_ett_decoder->p_sections);
p_ett_decoder->p_sections = NULL;
/* signal the new ETT */
p_ett_decoder->pf_ett_callback(p_ett_decoder->p_cb_data,
p_ett_decoder->p_building_ett);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitETT(p_ett_decoder, false);
assert(p_ett_decoder->p_sections == NULL);
}
dvbpsi_DeletePSISections(p_section);
}
/*****************************************************************************
......
......@@ -499,19 +499,12 @@ static void dvbpsi_atsc_GatherMGTSections(dvbpsi_t * p_dvbpsi,
/* Decode the sections */
dvbpsi_atsc_DecodeMGTSections(p_mgt_decoder->p_building_mgt,
p_mgt_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_mgt_decoder->p_sections);
p_mgt_decoder->p_sections = NULL;
p_section = NULL;
/* signal the new MGT */
p_mgt_decoder->pf_mgt_callback(p_mgt_decoder->p_cb_data,
p_mgt_decoder->p_building_mgt);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitMGT(p_mgt_decoder, false);
}
if( NULL != p_section )
{
dvbpsi_DeletePSISections(p_section);
assert(p_mgt_decoder->p_sections == NULL);
}
}
......
......@@ -404,14 +404,12 @@ static void dvbpsi_atsc_GatherSTTSections(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_atsc_DecodeSTTSections(p_stt_decoder->p_building_stt,
p_stt_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_stt_decoder->p_sections);
p_stt_decoder->p_sections = NULL;
/* signal the new STT */
p_stt_decoder->pf_stt_callback(p_stt_decoder->p_cb_data,
p_stt_decoder->p_building_stt);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitSTT(p_stt_decoder, false);
assert(p_stt_decoder->p_sections == NULL);
}
}
......
......@@ -537,14 +537,12 @@ static void dvbpsi_atsc_GatherVCTSections(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_atsc_DecodeVCTSections(p_vct_decoder->p_building_vct,
p_vct_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_vct_decoder->p_sections);
p_vct_decoder->p_sections = NULL;
/* signal the new VCT */
p_vct_decoder->pf_vct_callback(p_vct_decoder->p_cb_data,
p_vct_decoder->p_building_vct);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitVCT(p_vct_decoder, false);
assert(p_vct_decoder->p_sections == NULL);
}
}
......
......@@ -447,14 +447,12 @@ void dvbpsi_bat_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_bat_sections_decode(p_bat_decoder->p_building_bat,
p_bat_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_bat_decoder->p_sections);
p_bat_decoder->p_sections = NULL;
/* signal the new BAT */
p_bat_decoder->pf_bat_callback(p_bat_decoder->p_cb_data,
p_bat_decoder->p_building_bat);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitBAT(p_bat_decoder, false);
assert(p_bat_decoder->p_sections == NULL);
}
}
......
......@@ -323,14 +323,12 @@ void dvbpsi_cat_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_cat_sections_decode(p_cat_decoder->p_building_cat,
p_cat_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_cat_decoder->p_sections);
p_cat_decoder->p_sections = NULL;
/* signal the new CAT */
p_cat_decoder->pf_cat_callback(p_cat_decoder->p_cb_data,
p_cat_decoder->p_building_cat);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitCAT(p_cat_decoder, false);
assert(p_cat_decoder->p_sections == NULL);
}
}
......
......@@ -498,15 +498,12 @@ void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_private_
dvbpsi_eit_sections_decode(p_eit_decoder->p_building_eit,
p_eit_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_eit_decoder->p_sections);
p_eit_decoder->p_sections = NULL;
/* signal the new EIT */
p_eit_decoder->pf_eit_callback(p_eit_decoder->p_cb_data, p_eit_decoder->p_building_eit);
/* Reinitialize the structures */
p_eit_decoder->p_building_eit = NULL;
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitEIT(p_eit_decoder, false);
assert(p_eit_decoder->p_sections == NULL);
}
}
......
......@@ -436,14 +436,12 @@ void dvbpsi_nit_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_nit_sections_decode(p_nit_decoder->p_building_nit,
p_nit_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_nit_decoder->p_sections);
p_nit_decoder->p_sections = NULL;
/* signal the new NIT */
p_nit_decoder->pf_nit_callback(p_nit_decoder->p_cb_data,
p_nit_decoder->p_building_nit);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitNIT(p_nit_decoder, false);
assert(p_nit_decoder->p_sections == NULL);
}
}
......
......@@ -393,14 +393,12 @@ void dvbpsi_pmt_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_sect
/* Decode the sections */
dvbpsi_pmt_sections_decode(p_pmt_decoder->p_building_pmt,
p_pmt_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_pmt_decoder->p_sections);
p_pmt_decoder->p_sections = NULL;
/* signal the new PMT */
p_pmt_decoder->pf_pmt_callback(p_pmt_decoder->p_cb_data,
p_pmt_decoder->p_building_pmt);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitPMT(p_pmt_decoder, false);
assert(p_pmt_decoder->p_sections == NULL);
}
}
......
......@@ -386,14 +386,12 @@ void dvbpsi_rst_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_rst_sections_decode(p_rst_decoder->p_building_rst,
p_rst_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_rst_decoder->p_sections);
p_rst_decoder->p_sections = NULL;
/* signal the new CAT */
p_rst_decoder->pf_rst_callback(p_rst_decoder->p_cb_data,
p_rst_decoder->p_building_rst);
/* Reinitialize the structures */
/* Delete sectioins and Reinitialize the structures */
dvbpsi_rst_reset(p_rst_decoder, false);
assert(p_rst_decoder->p_sections == NULL);
}
}
......
......@@ -419,14 +419,12 @@ void dvbpsi_sdt_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_sdt_sections_decode(p_sdt_decoder->p_building_sdt,
p_sdt_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_sdt_decoder->p_sections);
p_sdt_decoder->p_sections = NULL;
/* signal the new SDT */
p_sdt_decoder->pf_sdt_callback(p_sdt_decoder->p_cb_data,
p_sdt_decoder->p_building_sdt);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitSDT(p_sdt_decoder, false);
assert(p_sdt_decoder->p_sections == NULL);
}
}
......
......@@ -405,14 +405,12 @@ void dvbpsi_sis_sections_gather(dvbpsi_t *p_dvbpsi,
/* Decode the sections */
dvbpsi_sis_sections_decode(p_dvbpsi, p_sis_decoder->p_building_sis,
p_sis_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_sis_decoder->p_sections);
p_sis_decoder->p_sections = NULL;
/* signal the new SDT */
p_sis_decoder->pf_sis_callback(p_sis_decoder->p_cb_data,
p_sis_decoder->p_building_sis);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitSIS(p_sis_decoder, false);
assert(p_sis_decoder->p_sections == NULL);
}
}
......
......@@ -382,14 +382,12 @@ void dvbpsi_tot_sections_gather(dvbpsi_t* p_dvbpsi,
/* Decode the sections */
dvbpsi_tot_sections_decode(p_dvbpsi, p_tot_decoder->p_building_tot,
p_tot_decoder->p_sections);
/* Delete the sections */
dvbpsi_DeletePSISections(p_tot_decoder->p_sections);
p_tot_decoder->p_sections = NULL;
/* signal the new TOT */
p_tot_decoder->pf_tot_callback(p_tot_decoder->p_cb_data,
p_tot_decoder->p_building_tot);
/* Reinitialize the structures */
/* Delete sections and Reinitialize the structures */
dvbpsi_ReInitTOT(p_tot_decoder, false);
assert(p_tot_decoder->p_sections == NULL);
}
}
......
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