Commit 76902d9b authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/*: make decoder->b_discontinuity an decoder->b_complete_header a boolean

The dvbpsi_decoder_t members b_discontinuity and b_complete_header are used as a boolean.
parent 5e153880
......@@ -66,7 +66,7 @@ bool dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
/* PSI decoder initial state */
p_demux->i_continuity_counter = 31;
p_demux->b_discontinuity = 1;
p_demux->b_discontinuity = true;
p_demux->p_current_section = NULL;
/* Subtables demux configuration */
......
......@@ -252,7 +252,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
"TS discontinuity (received %d, expected %d) for PID %d",
p_decoder->i_continuity_counter, i_expected_counter,
((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
p_decoder->b_discontinuity = 1;
p_decoder->b_discontinuity = true;
if(p_decoder->p_current_section)
{
dvbpsi_DeletePSISections(p_decoder->p_current_section);
......@@ -297,7 +297,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
p_new_pos = NULL;
/* Just need the header to know how long is the section */
p_decoder->i_need = 3;
p_decoder->b_complete_header = 0;
p_decoder->b_complete_header = false;
}
else
{
......@@ -323,7 +323,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
if(!p_decoder->b_complete_header)
{
/* Header is complete */
p_decoder->b_complete_header = 1;
p_decoder->b_complete_header = true;
/* Compute p_section->i_length and update p_decoder->i_need */
p_decoder->i_need = p_section->i_length
= ((uint16_t)(p_section->p_data[1] & 0xf)) << 8
......@@ -344,7 +344,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
p_payload_pos = p_new_pos;
p_new_pos = NULL;
p_decoder->i_need = 3;
p_decoder->b_complete_header = 0;
p_decoder->b_complete_header = false;
i_available = 188 + p_data - p_payload_pos;
}
else
......@@ -414,7 +414,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
p_payload_pos = p_new_pos;
p_new_pos = NULL;
p_decoder->i_need = 3;
p_decoder->b_complete_header = 0;
p_decoder->b_complete_header = false;
i_available = 188 + p_data - p_payload_pos;
}
else
......
......@@ -183,10 +183,10 @@ typedef void (* dvbpsi_callback)(dvbpsi_t *p_dvbpsi,
dvbpsi_callback pf_callback; /*!< PSI decoder's callback */ \
int i_section_max_size; /*!< Max size of a section for this decoder */ \
uint8_t i_continuity_counter; /*!< Continuity counter */ \
int b_discontinuity; /*!< Discontinuity flag */ \
bool b_discontinuity; /*!< Discontinuity flag */ \
dvbpsi_psi_section_t *p_current_section; /*!< Current section */ \
int i_need; /*!< Bytes needed */ \
int b_complete_header; /*!< Flag for header completion */
bool b_complete_header; /*!< Flag for header completion */
struct dvbpsi_decoder_s
{
......
......@@ -286,7 +286,7 @@ void dvbpsi_GatherEITSections(dvbpsi_t *p_dvbpsi, void *p_private_decoder,
if (p_demux->b_discontinuity)
{
b_reinit = 1;
p_demux->b_discontinuity = 0;
p_demux->b_discontinuity = false;
}
else
{
......
......@@ -322,7 +322,7 @@ void dvbpsi_GatherNITSections(dvbpsi_t *p_dvbpsi,
if (p_nit_decoder->b_discontinuity)
{
b_reinit = 1;
p_nit_decoder->b_discontinuity = 0;
p_nit_decoder->b_discontinuity = false;
}
else
{
......
......@@ -288,7 +288,7 @@ void dvbpsi_GatherPMTSections(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_sectio
if (p_pmt_decoder->b_discontinuity)
{
b_reinit = true;
p_pmt_decoder->b_discontinuity = 0;
p_pmt_decoder->b_discontinuity = false;
}
else
{
......
......@@ -288,7 +288,7 @@ void dvbpsi_GatherSDTSections(dvbpsi_t *p_dvbpsi,
if (p_demux->b_discontinuity)
{
b_reinit = 1;
p_demux->b_discontinuity = 0;
p_demux->b_discontinuity = false;
}
else
{
......
......@@ -273,7 +273,7 @@ void dvbpsi_GatherSISSections(dvbpsi_t *p_dvbpsi,
if (p_demux->b_discontinuity)
{
b_reinit = 1;
p_demux->b_discontinuity = 0;
p_demux->b_discontinuity = false;
}
else
{
......
......@@ -230,7 +230,7 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
{
/* We don't care about discontinuities with the TDT/TOT as it
only consists of one section anyway */
p_tot_decoder->b_discontinuity = 0;
p_tot_decoder->b_discontinuity = false;
}
p_building_tot = (dvbpsi_tot_t*)malloc(sizeof(dvbpsi_tot_t));
......
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