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

Cleanup EIT generator

Cleanup EIT generator as merged from his Sašo Kiselkov repository.
parent e88e9a83
...@@ -621,14 +621,17 @@ static inline void EncodeEventHeaders(dvbpsi_eit_event_t *p_event, uint8_t *buf) ...@@ -621,14 +621,17 @@ static inline void EncodeEventHeaders(dvbpsi_eit_event_t *p_event, uint8_t *buf)
***************************************************************************** *****************************************************************************
* Generate EIT sections based on the dvbpsi_eit_t structure. * Generate EIT sections based on the dvbpsi_eit_t structure.
*****************************************************************************/ *****************************************************************************/
dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit, dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
uint8_t i_table_id) uint8_t i_table_id)
{ {
dvbpsi_psi_section_t *p_result = NewEITSection (p_eit, i_table_id, 0), dvbpsi_psi_section_t *p_result = NewEITSection (p_eit, i_table_id, 0);
*p_current = p_result; dvbpsi_psi_section_t *p_current = p_result;
uint8_t i_last_section_number = 0; uint8_t i_last_section_number = 0;
dvbpsi_eit_event_t *p_event; dvbpsi_eit_event_t *p_event;
if (!p_current)
return NULL;
/* Encode events */ /* Encode events */
for (p_event = p_eit->p_first_event; p_event; p_event = p_event->p_next) for (p_event = p_eit->p_first_event; p_event; p_event = p_event->p_next)
{ {
...@@ -669,7 +672,7 @@ dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit, ...@@ -669,7 +672,7 @@ dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit,
if ((p_current->p_payload_end - p_current->p_data) + if ((p_current->p_payload_end - p_current->p_data) +
p_descriptor->i_length > 4090) p_descriptor->i_length > 4090)
{ {
DVBPSI_ERROR("EIT generator", "too many descriptors in event, " dvbpsi_error(p_dvbpsi, "EIT generator", "too many descriptors in event, "
"unable to carry all the descriptors"); "unable to carry all the descriptors");
break; break;
} }
...@@ -697,7 +700,7 @@ dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit, ...@@ -697,7 +700,7 @@ dvbpsi_psi_section_t* dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit,
p_current->p_data[12] = i_last_section_number; p_current->p_data[12] = i_last_section_number;
p_current->i_last_number = i_last_section_number; p_current->i_last_number = i_last_section_number;
dvbpsi_BuildPSISection(p_current); dvbpsi_BuildPSISection(p_dvbpsi, p_current);
} }
return p_result; return p_result;
......
...@@ -251,7 +251,16 @@ dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor( ...@@ -251,7 +251,16 @@ dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
***************************************************************************** *****************************************************************************
* Generate EIT sections based on the dvbpsi_eit_t structure. * Generate EIT sections based on the dvbpsi_eit_t structure.
*****************************************************************************/ *****************************************************************************/
dvbpsi_psi_section_t *dvbpsi_GenEITSections(dvbpsi_eit_t *p_eit, /*!
* \fn dvbpsi_psi_section_t *dvbpsi_GenEITSections(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
* uint8_t i_table_id);
* \brief Generate a EIT section based on the information provided in p_eit.
* \param p_dvbpsi pointer to Subtable demultiplexor to which the EIT decoder is attached.
* \param p_eit pointer to EIT information to include in the PSI secion
* \param i_table_id the EIT table id to use
* \return a pointer to a new PSI section
*/
dvbpsi_psi_section_t *dvbpsi_GenEITSections(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
uint8_t i_table_id); uint8_t i_table_id);
#ifdef __cplusplus #ifdef __cplusplus
......
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