[dvblast-devel] [PATCH] Issue with bit 33 in PCR

Georgi Chorbadzhiyski gf at unixsol.org
Mon Jun 25 12:28:40 CEST 2012


Around 06/22/2012 09:27 AM, Vladimir Yakovlev scribbled:
> Corrected issue of lost bit in PCR due to bit shift more then 32 bit.
> ---
>  mpeg/ts.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mpeg/ts.h b/mpeg/ts.h
> index 4bcedc5..c343916 100644
> --- a/mpeg/ts.h
> +++ b/mpeg/ts.h
> @@ -250,7 +250,7 @@ static inline bool tsaf_has_pcr(const uint8_t *p_ts)
>  
>  static inline uint64_t tsaf_get_pcr(const uint8_t *p_ts)
>  {
> -    return (p_ts[6] << 25) | (p_ts[7] << 17) | (p_ts[8] << 9) | (p_ts[9] << 1) |
> +    return ((uint64_t) p_ts[6] << 25) | (p_ts[7] << 17) | (p_ts[8] << 9) | (p_ts[9] << 1) |
>             (p_ts[10] >> 7);
>  }

Applied.

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




More information about the dvblast-devel mailing list