aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Paul Saman <jean-paul.saman@m2x.nl>2013-10-30 14:41:15 (GMT)
committerJean-Paul Saman <jpsaman@videolan.org>2013-11-05 08:01:26 (GMT)
commite84c0d254702e5ac4f4d2356b8c922831f928b7f (patch)
tree674d0c9c24317435ef5b4756d26d90d264609f24
parentbd1b007bec268d8db3ad4ce063e3a5e6863f994d (diff)
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. (cherry picked from commit c1d884e6febc53fade4223e825510028434f125b) Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
-rw-r--r--src/tables/atsc_eit.c6
-rw-r--r--src/tables/atsc_ett.c7
-rw-r--r--src/tables/atsc_mgt.c11
-rw-r--r--src/tables/atsc_stt.c6
-rw-r--r--src/tables/atsc_vct.c6
-rw-r--r--src/tables/bat.c6
-rw-r--r--src/tables/cat.c6
-rw-r--r--src/tables/eit.c9
-rw-r--r--src/tables/nit.c6
-rw-r--r--src/tables/pmt.c6
-rw-r--r--src/tables/rst.c6
-rw-r--r--src/tables/sdt.c6
-rw-r--r--src/tables/sis.c6
-rw-r--r--src/tables/tot.c6
14 files changed, 29 insertions, 64 deletions
diff --git a/src/tables/atsc_eit.c b/src/tables/atsc_eit.c
index 3dea1bc..b276fd1 100644
--- a/src/tables/atsc_eit.c
+++ b/src/tables/atsc_eit.c
@@ -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);
}
}
diff --git a/src/tables/atsc_ett.c b/src/tables/atsc_ett.c
index 300007b..2caa446 100644
--- a/src/tables/atsc_ett.c
+++ b/src/tables/atsc_ett.c
@@ -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);
}
/*****************************************************************************
diff --git a/src/tables/atsc_mgt.c b/src/tables/atsc_mgt.c
index c410e59..ef0eb20 100644
--- a/src/tables/atsc_mgt.c
+++ b/src/tables/atsc_mgt.c
@@ -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);
}
}
diff --git a/src/tables/atsc_stt.c b/src/tables/atsc_stt.c
index c3f23cb..88340ae 100644
--- a/src/tables/atsc_stt.c
+++ b/src/tables/atsc_stt.c
@@ -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);
}
}
diff --git a/src/tables/atsc_vct.c b/src/tables/atsc_vct.c
index 1c0e09e..7a4ccf4 100644
--- a/src/tables/atsc_vct.c
+++ b/src/tables/atsc_vct.c
@@ -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);
}
}
diff --git a/src/tables/bat.c b/src/tables/bat.c
index 6d52ba0..f4171f8 100644
--- a/src/tables/bat.c
+++ b/src/tables/bat.c
@@ -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);
}
}
diff --git a/src/tables/cat.c b/src/tables/cat.c
index 7b366b4..385c50d 100644
--- a/src/tables/cat.c
+++ b/src/tables/cat.c
@@ -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);
}
}
diff --git a/src/tables/eit.c b/src/tables/eit.c
index a319ab4..6e359a2 100644
--- a/src/tables/eit.c
+++ b/src/tables/eit.c
@@ -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);
}
}
diff --git a/src/tables/nit.c b/src/tables/nit.c
index f155a48..c4bca0b 100644
--- a/src/tables/nit.c
+++ b/src/tables/nit.c
@@ -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);
}
}
diff --git a/src/tables/pmt.c b/src/tables/pmt.c
index 35836b8..9a89f93 100644
--- a/src/tables/pmt.c
+++ b/src/tables/pmt.c
@@ -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);
}
}
diff --git a/src/tables/rst.c b/src/tables/rst.c
index 19e8e09..2198c61 100644
--- a/src/tables/rst.c
+++ b/src/tables/rst.c
@@ -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);
}
}
diff --git a/src/tables/sdt.c b/src/tables/sdt.c
index c5671ce..a159773 100644
--- a/src/tables/sdt.c
+++ b/src/tables/sdt.c
@@ -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);
}
}
diff --git a/src/tables/sis.c b/src/tables/sis.c
index c5d375b..602bb7a 100644
--- a/src/tables/sis.c
+++ b/src/tables/sis.c
@@ -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);
}
}
diff --git a/src/tables/tot.c b/src/tables/tot.c
index 062d2c2..9cde087 100644
--- a/src/tables/tot.c
+++ b/src/tables/tot.c
@@ -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);
}
}

Privacy Policy