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

src/dvbpsi.{c,h}: changed dvbpsi_PushPacket() prototype

Change prototype of dvbpsi_PushPacket() to return bool iso void
parent 5901abc2
...@@ -212,7 +212,7 @@ bool dvbpsi_HasDecoder(dvbpsi_t *p_dvbpsi) ...@@ -212,7 +212,7 @@ bool dvbpsi_HasDecoder(dvbpsi_t *p_dvbpsi)
***************************************************************************** *****************************************************************************
* Injection of a TS packet into a PSI decoder. * Injection of a TS packet into a PSI decoder.
*****************************************************************************/ *****************************************************************************/
void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) bool dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
{ {
uint8_t i_expected_counter; /* Expected continuity counter */ uint8_t i_expected_counter; /* Expected continuity counter */
dvbpsi_psi_section_t* p_section; /* Current section */ dvbpsi_psi_section_t* p_section; /* Current section */
...@@ -231,7 +231,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -231,7 +231,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
if (p_data[0] != 0x47) if (p_data[0] != 0x47)
{ {
dvbpsi_error(handle, "PSI decoder", "not a TS packet"); dvbpsi_error(handle, "PSI decoder", "not a TS packet");
return; return false;
} }
/* Continuity check */ /* Continuity check */
...@@ -250,7 +250,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -250,7 +250,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
"TS duplicate (received %d, expected %d) for PID %d", "TS duplicate (received %d, expected %d) for PID %d",
p_decoder->i_continuity_counter, i_expected_counter, p_decoder->i_continuity_counter, i_expected_counter,
((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]); ((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
return; return false;
} }
if (i_expected_counter != p_decoder->i_continuity_counter) if (i_expected_counter != p_decoder->i_continuity_counter)
...@@ -270,7 +270,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -270,7 +270,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
/* Return if no payload in the TS packet */ /* Return if no payload in the TS packet */
if (!(p_data[3] & 0x10)) if (!(p_data[3] & 0x10))
return; return false;
/* Skip the adaptation_field if present */ /* Skip the adaptation_field if present */
if (p_data[3] & 0x20) if (p_data[3] & 0x20)
...@@ -287,7 +287,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -287,7 +287,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
p_section = p_decoder->p_current_section; p_section = p_decoder->p_current_section;
/* If the psi decoder needs a begginning of section and a new section /* If the psi decoder needs a beginning of a section and a new section
begins in the packet then initialize the dvbpsi_psi_section_t structure */ begins in the packet then initialize the dvbpsi_psi_section_t structure */
if (p_section == NULL) if (p_section == NULL)
{ {
...@@ -308,7 +308,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -308,7 +308,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
else else
{ {
/* No new section => return */ /* No new section => return */
return; return false;
} }
} }
...@@ -439,6 +439,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data) ...@@ -439,6 +439,7 @@ void dvbpsi_PushPacket(dvbpsi_t *handle, uint8_t* p_data)
i_available = 0; i_available = 0;
} }
} }
return true;
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -133,15 +133,15 @@ void dvbpsi_DeleteHandle(dvbpsi_t *handle); ...@@ -133,15 +133,15 @@ void dvbpsi_DeleteHandle(dvbpsi_t *handle);
* dvbpsi_PushPacket * dvbpsi_PushPacket
*****************************************************************************/ *****************************************************************************/
/*! /*!
* \fn void dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data) * \fn bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
* \brief Injection of a TS packet into a PSI decoder. * \brief Injection of a TS packet into a PSI decoder.
* \param p_dvbpsi handle to dvbpsi with attached decoder * \param p_dvbpsi handle to dvbpsi with attached decoder
* \param p_data pointer to a 188 bytes playload of a TS packet * \param p_data pointer to a 188 bytes playload of a TS packet
* \return nothing. * \return true when packet has been handled, false on error.
* *
* Injection of a TS packet into a PSI decoder. * Injection of a TS packet into a PSI decoder.
*/ */
void dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data); bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data);
/***************************************************************************** /*****************************************************************************
* The following definitions are just here to allow external decoders but * The following definitions are just here to allow external decoders but
......
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