Commit aff54341 authored by Olivier Braun's avatar Olivier Braun

Don't perform continuity check if there is no payload

According to ISO 13818-1: The continuity_counter shall not be incremented when the adaptation_field_control of the packet equals '00' or '10'.
parent 36d88fa6
...@@ -285,6 +285,10 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data) ...@@ -285,6 +285,10 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
return false; return false;
} }
/* Return if no payload in the TS packet */
if (!(p_data[3] & 0x10))
return false;
/* Continuity check */ /* Continuity check */
const bool b_first = (p_decoder->i_continuity_counter == DVBPSI_INVALID_CC); const bool b_first = (p_decoder->i_continuity_counter == DVBPSI_INVALID_CC);
if (b_first) if (b_first)
...@@ -329,10 +333,6 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data) ...@@ -329,10 +333,6 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
memcpy(p_decoder->prevpacket, p_data, 188); memcpy(p_decoder->prevpacket, p_data, 188);
/* Return if no payload in the TS packet */
if (!(p_data[3] & 0x10))
return false;
/* Skip the adaptation_field if present */ /* Skip the adaptation_field if present */
if (p_data[3] & 0x20) if (p_data[3] & 0x20)
p_payload_pos = p_data + 5 + p_data[4]; p_payload_pos = p_data + 5 + p_data[4];
......
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