Commit a08bae07 authored by Christophe Massiot's avatar Christophe Massiot

* mpeg/ts.h: Slightly change the API for sections to avoid bugs.

parent 2bfc7f98
......@@ -539,7 +539,7 @@ static inline uint8_t *psi_assemble_payload(uint8_t **pp_psi_buffer,
*pp_psi_buffer = psi_private_allocate();
}
memcpy( *pp_psi_buffer + *pi_psi_buffer_used, *pp_payload, i_copy_size );
memcpy(*pp_psi_buffer + *pi_psi_buffer_used, *pp_payload, i_copy_size);
*pi_psi_buffer_used += i_copy_size;
if (*pi_psi_buffer_used >= PSI_HEADER_SIZE) {
......
......@@ -166,6 +166,14 @@ static inline uint8_t *ts_payload(uint8_t *p_ts)
}
static inline uint8_t *ts_section(uint8_t *p_ts)
{
if (!ts_get_unitstart(p_ts))
return ts_payload(p_ts);
return ts_payload(p_ts) + 1; /* pointer_field */
}
static inline uint8_t *ts_next_section(uint8_t *p_ts)
{
uint8_t *p_payload;
......
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