Commit 8d80020f authored by Jean-Paul Saman's avatar Jean-Paul Saman

EIT: remember descriptors_loop_length per event.

parent cedb80cf
...@@ -1316,7 +1316,7 @@ static void DumpEITEventDescriptors(dvbpsi_eit_event_t *p_eit_event) ...@@ -1316,7 +1316,7 @@ static void DumpEITEventDescriptors(dvbpsi_eit_event_t *p_eit_event)
printf("\t | Duration: %d\n", p_event->i_duration); printf("\t | Duration: %d\n", p_event->i_duration);
printf("\t | Running status: %d\n", p_event->i_running_status); printf("\t | Running status: %d\n", p_event->i_running_status);
printf("\t | Free CA mode: %s\n", p_event->b_free_ca ? "yes" : "no"); printf("\t | Free CA mode: %s\n", p_event->b_free_ca ? "yes" : "no");
printf("\t | Descriptor loop length: %d\n", p_event->i_descriptors_length); printf("\t | Descriptor loop length: %d bytes\n", p_event->i_descriptors_length);
DumpDescriptors("\t | ]", p_event->p_first_descriptor); DumpDescriptors("\t | ]", p_event->p_first_descriptor);
p_event = p_event->p_next; p_event = p_event->p_next;
......
...@@ -207,7 +207,7 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit) ...@@ -207,7 +207,7 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit)
*****************************************************************************/ *****************************************************************************/
dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit, dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration, uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
uint8_t i_running_status, bool b_free_ca) uint8_t i_running_status, bool b_free_ca, uint16_t i_event_descriptor_length)
{ {
dvbpsi_eit_event_t* p_event; dvbpsi_eit_event_t* p_event;
p_event = (dvbpsi_eit_event_t*)calloc(1,sizeof(dvbpsi_eit_event_t)); p_event = (dvbpsi_eit_event_t*)calloc(1,sizeof(dvbpsi_eit_event_t));
...@@ -220,6 +220,7 @@ dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit, ...@@ -220,6 +220,7 @@ dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
p_event->i_running_status = i_running_status; p_event->i_running_status = i_running_status;
p_event->b_free_ca = b_free_ca; p_event->b_free_ca = b_free_ca;
p_event->p_next = NULL; p_event->p_next = NULL;
p_event->i_descriptors_length = i_event_descriptor_length;
p_event->p_first_descriptor = NULL; p_event->p_first_descriptor = NULL;
if (p_eit->p_first_event == NULL) if (p_eit->p_first_event == NULL)
...@@ -516,7 +517,8 @@ void dvbpsi_eit_sections_decode(dvbpsi_eit_t* p_eit, ...@@ -516,7 +517,8 @@ void dvbpsi_eit_sections_decode(dvbpsi_eit_t* p_eit,
uint16_t i_ev_length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11]; uint16_t i_ev_length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11];
dvbpsi_eit_event_t* p_event = dvbpsi_eit_event_add(p_eit, dvbpsi_eit_event_t* p_event = dvbpsi_eit_event_add(p_eit,
i_event_id, i_start_time, i_duration, i_event_id, i_start_time, i_duration,
i_running_status, b_free_ca); i_running_status, b_free_ca, i_ev_length);
/* Event descriptors */ /* Event descriptors */
p_byte += 12; p_byte += 12;
p_end = p_byte + i_ev_length; p_end = p_byte + i_ev_length;
......
...@@ -212,7 +212,8 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit); ...@@ -212,7 +212,8 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit);
uint64_t i_start_time, uint64_t i_start_time,
uint32_t i_duration, uint32_t i_duration,
uint8_t i_running_status, uint8_t i_running_status,
bool b_free_ca) bool b_free_ca,
uint16_t i_event_descriptor_length)
* \brief Add a service description at the end of the EIT. * \brief Add a service description at the end of the EIT.
* \param p_eit pointer to the EIT structure * \param p_eit pointer to the EIT structure
* \param i_event_id Event ID * \param i_event_id Event ID
...@@ -220,11 +221,14 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit); ...@@ -220,11 +221,14 @@ void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit);
* \param i_duration Duration * \param i_duration Duration
* \param i_running_status Running status * \param i_running_status Running status
* \param b_free_ca Free CA flag * \param b_free_ca Free CA flag
* \param i_event_descriptor_length The descriptors loop length in bytes of
all descriptors for this event.
* \return a pointer to the added service description. * \return a pointer to the added service description.
*/ */
dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit, dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration, uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
uint8_t i_running_status, bool b_free_ca); uint8_t i_running_status, bool b_free_ca,
uint16_t i_event_descriptor_length);
/***************************************************************************** /*****************************************************************************
* dvbpsi_eit_event_descriptor_add * dvbpsi_eit_event_descriptor_add
......
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