[dvblast-devel] [PATCH] dvb/pes: Fix for PES payload offset

Georgi Chorbadzhiyski gf at unixsol.org
Sat Sep 15 15:34:34 CEST 2012


On 15.9.2012 г. 00:32, Vladimir Yakovlev wrote:
> In pes_payload was not accounted size of optional header,
> only for actual data in PES_data_packet_header_length.
> ---
>   mpeg/pes.h |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mpeg/pes.h b/mpeg/pes.h
> index 98a45f8..7aba4d4 100644
> --- a/mpeg/pes.h
> +++ b/mpeg/pes.h
> @@ -49,6 +49,7 @@ extern "C"
>   #define PES_HEADER_SIZE_NOPTS   9
>   #define PES_HEADER_SIZE_PTS     14
>   #define PES_HEADER_SIZE_PTSDTS  19
> +#define PES_HEADER_OPTIONAL_SIZE   3
>
>   #define PES_STREAM_ID_MIN           0xbc
>   #define PES_STREAM_ID_PRIVATE_1     0xbd
> @@ -131,7 +132,7 @@ static inline bool pes_validate(const uint8_t *p_pes)
>    *****************************************************************************/
>   static inline uint8_t *pes_payload(uint8_t *p_pes)
>   {
> -    return p_pes + PES_HEADER_SIZE + pes_get_headerlength(p_pes);
> +    return p_pes + PES_HEADER_SIZE + PES_HEADER_OPTIONAL_SIZE + pes_get_headerlength(p_pes);
>   }
>
>   #ifdef __cplusplus
>

Isn't optional size depending on a flag? I have to check the standard.

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/


More information about the dvblast-devel mailing list