Commit 9e0d751e authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/tables/tot.c: Cleanup

- remove b_append from dvbpsi_GatherTOTSections()
parent 0eebb7f2
/*****************************************************************************
* tot.c: TDT/TOT decoder/generator
*----------------------------------------------------------------------------
* Copyright (C) 2001-2010 VideoLAN
* Copyright (C) 2001-2011 VideoLAN
* $Id$
*
* Authors: Johann Hanne
......@@ -200,8 +200,6 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
dvbpsi_tot_decoder_t* p_tot_decoder
= (dvbpsi_tot_decoder_t*)p_private_decoder;
int b_append = 1;
dvbpsi_tot_t* p_building_tot;
dvbpsi_debug(p_dvbpsi, "TDT/TOT decoder", "got a section");
......@@ -211,20 +209,19 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
dvbpsi_error(p_dvbpsi, "TDT/TOT decoder",
"invalid section (table_id == 0x%02x)",
p_section->i_table_id);
b_append = 0;
dvbpsi_DeletePSISections(p_section);
return;
}
if (b_append && p_section->b_syntax_indicator != false)
if (p_section->b_syntax_indicator != false)
{
/* Invalid section_syntax_indicator */
dvbpsi_error(p_dvbpsi, "TDT/TOT decoder",
"invalid section (section_syntax_indicator != 0)");
b_append = 0;
dvbpsi_DeletePSISections(p_section);
return;
}
/* Now if b_append is true then we have a valid TDT/TOT section */
if (b_append)
{
/* TS discontinuity check */
if (p_tot_decoder->b_discontinuity)
{
......@@ -233,6 +230,7 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
p_tot_decoder->b_discontinuity = false;
}
dvbpsi_tot_t* p_building_tot;
p_building_tot = (dvbpsi_tot_t*)malloc(sizeof(dvbpsi_tot_t));
if (p_building_tot)
dvbpsi_InitTOT(p_building_tot, ((uint64_t)p_section->p_payload_start[0] << 32)
......@@ -249,11 +247,6 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
dvbpsi_DeletePSISections(p_section);
/* signal the new TDT/TOT */
p_tot_decoder->pf_tot_callback(p_tot_decoder->p_cb_data, p_building_tot);
}
else
{
dvbpsi_DeletePSISections(p_section);
}
}
/*****************************************************************************
......
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