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

dr_81, dr_86, dr_a1: Use helper functions.

Use helper functions:
- dvbpsi_CanDecodeAsDescriptor()
- dvbpsi_IsDescripterDecoded()
parent 9da92fa4
...@@ -48,11 +48,11 @@ dvbpsi_ac3_audio_dr_t *dvbpsi_DecodeAc3AudioDr(dvbpsi_descriptor_t *p_descriptor ...@@ -48,11 +48,11 @@ dvbpsi_ac3_audio_dr_t *dvbpsi_DecodeAc3AudioDr(dvbpsi_descriptor_t *p_descriptor
uint8_t * buf = p_descriptor->p_data; uint8_t * buf = p_descriptor->p_data;
/* Check the tag */ /* Check the tag */
if (p_descriptor->i_tag != 0x81) if (!dvbpsi_CanDecodeAsDescriptor(p_descriptor, 0x81))
return NULL; return NULL;
/* Don't decode twice */ /* Don't decode twice */
if (p_descriptor->p_decoded) if (dvbpsi_IsDescriptorDecoded(p_descriptor))
return p_descriptor->p_decoded; return p_descriptor->p_decoded;
/* Check length */ /* Check length */
......
...@@ -48,11 +48,11 @@ dvbpsi_caption_service_dr_t *dvbpsi_DecodeCaptionServiceDr(dvbpsi_descriptor_t * ...@@ -48,11 +48,11 @@ dvbpsi_caption_service_dr_t *dvbpsi_DecodeCaptionServiceDr(dvbpsi_descriptor_t *
uint8_t * buf = p_descriptor->p_data; uint8_t * buf = p_descriptor->p_data;
/* Check the tag */ /* Check the tag */
if (p_descriptor->i_tag != 0x86) if (!dvbpsi_CanDecodeAsDescriptor(p_descriptor, 0x86))
return NULL; return NULL;
/* Don't decode twice */ /* Don't decode twice */
if (p_descriptor->p_decoded) if (dvbpsi_IsDescriptorDecoded(p_descriptor))
return p_descriptor->p_decoded; return p_descriptor->p_decoded;
/* Check length */ /* Check length */
......
...@@ -51,11 +51,11 @@ dvbpsi_DecodeServiceLocationDr (dvbpsi_descriptor_t * p_descriptor) ...@@ -51,11 +51,11 @@ dvbpsi_DecodeServiceLocationDr (dvbpsi_descriptor_t * p_descriptor)
uint8_t *buf = p_descriptor->p_data; uint8_t *buf = p_descriptor->p_data;
/* Check the tag */ /* Check the tag */
if (p_descriptor->i_tag != 0xa1) if (!dvbpsi_CanDecodeAsDescriptor(p_descriptor, 0xa1))
return NULL; return NULL;
/* Don't decode twice */ /* Don't decode twice */
if (p_descriptor->p_decoded) if (dvbpsi_IsDescriptorDecoded(p_descriptor))
return p_descriptor->p_decoded; return p_descriptor->p_decoded;
/* Check length */ /* Check length */
......
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