From 1de6941482e7eb63f2bca5b15ffe1f145bea8205 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 25 Apr 2014 22:50:36 -0700 Subject: [PATCH] Correct PTS reading during audio demux. --- Core/HW/MpegDemux.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/HW/MpegDemux.h b/Core/HW/MpegDemux.h index abb98607d7..0a973e9c5c 100644 --- a/Core/HW/MpegDemux.h +++ b/Core/HW/MpegDemux.h @@ -28,8 +28,8 @@ public: private: struct PesHeader { - long pts; - long dts; + s64 pts; + s64 dts; int channel; PesHeader(int chan) { @@ -40,16 +40,16 @@ private: }; int read8() { - return m_buf[m_index++] & 0xFF; + return m_buf[m_index++]; } int read16() { return (read8() << 8) | read8(); } - long readPts() { + s64 readPts() { return readPts(read8()); } - long readPts(int c) { - return (((long) (c & 0x0E)) << 29) | ((read16() >> 1) << 15) | (read16() >> 1); + s64 readPts(int c) { + return (((s64) (c & 0x0E)) << 29) | ((read16() >> 1) << 15) | (read16() >> 1); } bool isEOF() { return m_index >= m_len;