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

Vladimir Yakovlev nagos at inbox.ru
Fri Jun 22 08:27:13 CEST 2012


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);
 }
 
-- 
1.7.1



More information about the dvblast-devel mailing list