aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2013-05-21 01:03:41 (GMT)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>2014-02-04 09:52:02 (GMT)
commit47c32bb3caffb6c7f32150dfe6d84ed3f70f0738 (patch)
tree74bb57a87ec011c2fed5f8114a9d576f09ba7ac6
parentbe8f6af07463dadc75b65e980d9d46b3b891cab1 (diff)
dr_86: convert from linked list to array
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r--src/descriptors/dr_86.c18
-rw-r--r--src/descriptors/dr_86.h4
2 files changed, 2 insertions, 20 deletions
diff --git a/src/descriptors/dr_86.c b/src/descriptors/dr_86.c
index 4d781a4..c6da64a 100644
--- a/src/descriptors/dr_86.c
+++ b/src/descriptors/dr_86.c
@@ -65,19 +65,12 @@ dvbpsi_caption_service_dr_t *dvbpsi_DecodeCaptionServiceDr(dvbpsi_descriptor_t *
p_descriptor->p_decoded = (void*)p_decoded;
- p_decoded->p_first_service = NULL;
-
p_decoded->i_number_of_services = 0x1f & buf[0];
buf++;
for (int i = 0; i < p_decoded->i_number_of_services; i++)
{
- dvbpsi_caption_service_t * p_service =
- (dvbpsi_caption_service_t*)malloc(sizeof(dvbpsi_caption_service_t));
-
- if (!p_service) return NULL;
-
- memset(p_service, 0, sizeof(dvbpsi_caption_service_t));
+ dvbpsi_caption_service_t * p_service = &p_decoded->services[i];
memcpy(p_service->i_iso_639_code, buf, 3);
buf += 3;
@@ -88,15 +81,6 @@ dvbpsi_caption_service_dr_t *dvbpsi_DecodeCaptionServiceDr(dvbpsi_descriptor_t *
p_service->b_easy_reader = 0x01 & (buf[0] >> 7);
p_service->b_wide_aspect_ratio = 0x01 & (buf[0] >> 6);
- if (p_decoded->p_first_service == NULL)
- p_decoded->p_first_service = p_service;
- else
- {
- dvbpsi_caption_service_t* p_last_service = p_decoded->p_first_service;
- while (p_last_service->p_next != NULL)
- p_last_service = p_last_service->p_next;
- p_last_service->p_next = p_service;
- }
buf += 2;
}
return p_decoded;
diff --git a/src/descriptors/dr_86.h b/src/descriptors/dr_86.h
index ceaf80d..b962678 100644
--- a/src/descriptors/dr_86.h
+++ b/src/descriptors/dr_86.h
@@ -55,8 +55,6 @@ typedef struct dvbpsi_caption_service_s
uint16_t i_caption_service_number;
int b_easy_reader;
int b_wide_aspect_ratio;
-
- struct dvbpsi_caption_service_s *p_next;
}dvbpsi_caption_service_t;
/*****************************************************************************
@@ -75,7 +73,7 @@ typedef struct dvbpsi_caption_service_s
typedef struct dvbpsi_caption_service_dr_s
{
uint8_t i_number_of_services;
- dvbpsi_caption_service_t *p_first_service;
+ dvbpsi_caption_service_t services[0x1f];
}dvbpsi_caption_service_dr_t;
/*****************************************************************************

Privacy Policy