Commit efa69cd2 authored by Brad Bitterman's avatar Brad Bitterman Committed by Jean-Paul Saman

ATSC: fix corruption of PSI tables

Various bugs were fixed that made ATSC tables not work optimally if at all.
parent f32aaf27
......@@ -360,7 +360,7 @@ static bool dvbpsi_AddSectionEIT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_eit_decoder_t *
p_section->p_payload_start[0],
p_section->i_extension,
p_section->b_current_next);
if (p_decoder->p_building_eit)
if (!p_decoder->p_building_eit)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
......
......@@ -297,7 +297,7 @@ static bool dvbpsi_AddSectionETT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_ett_decoder_t *
p_section->p_payload_start[0],
i_etm_id,
p_section->b_current_next);
if (p_decoder->p_building_ett)
if (!p_decoder->p_building_ett)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
......
......@@ -384,7 +384,7 @@ static bool dvbpsi_AddSectionMGT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_mgt_decoder_t *
p_section->i_version,
p_section->p_payload_start[0],
p_section->b_current_next);
if (p_decoder->p_building_mgt)
if (!p_decoder->p_building_mgt)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
......@@ -502,13 +502,17 @@ static void dvbpsi_atsc_GatherMGTSections(dvbpsi_t * p_dvbpsi,
/* 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 */
dvbpsi_ReInitMGT(p_mgt_decoder, false);
}
if( NULL != p_section )
{
dvbpsi_DeletePSISections(p_section);
}
}
/*****************************************************************************
......
......@@ -288,7 +288,7 @@ static bool dvbpsi_AddSectionSTT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_stt_decoder_t *
{
p_decoder->p_building_stt = dvbpsi_atsc_NewSTT(p_section->i_table_id, p_section->i_extension,
p_section->i_version, p_section->b_current_next);
if (p_decoder->p_building_stt)
if (!p_decoder->p_building_stt)
return false;
p_decoder->i_last_section_number = p_section->i_last_number;
......
......@@ -423,7 +423,7 @@ static bool dvbpsi_AddSectionVCT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_vct_decoder_t *
p_section->i_table_id, p_section->i_extension,
p_section->p_payload_start[0], p_section->i_table_id == 0xC9,
p_section->i_version, p_section->b_current_next);
if (p_vct_decoder->p_building_vct)
if (!p_vct_decoder->p_building_vct)
return false;
p_vct_decoder->i_last_section_number = p_section->i_last_number;
......
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