Browse Source

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

master
Christophe Massiot 14 years ago
parent
commit
a08bae073a
2 changed files with 9 additions and 1 deletions
  1. +1
    -1
      mpeg/psi.h
  2. +8
    -0
      mpeg/ts.h

+ 1
- 1
mpeg/psi.h View File

@ -539,7 +539,7 @@ static inline uint8_t *psi_assemble_payload(uint8_t **pp_psi_buffer,
*pp_psi_buffer = psi_private_allocate(); *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; *pi_psi_buffer_used += i_copy_size;
if (*pi_psi_buffer_used >= PSI_HEADER_SIZE) { if (*pi_psi_buffer_used >= PSI_HEADER_SIZE) {

+ 8
- 0
mpeg/ts.h View File

@ -166,6 +166,14 @@ static inline uint8_t *ts_payload(uint8_t *p_ts)
} }
static inline uint8_t *ts_section(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; uint8_t *p_payload;

Loading…
Cancel
Save