From 14ba80ec22bf0d3c216e247e63dc78a73ae4639f Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Tue, 26 Sep 2006 13:05:39 +0000 Subject: [PATCH] *** empty log message *** --- demuxer.cc | 6 ++---- demuxer.h | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demuxer.cc b/demuxer.cc index b519960..3b1c6d9 100644 --- a/demuxer.cc +++ b/demuxer.cc @@ -315,8 +315,6 @@ UINT Demuxer::PESPacket::findPictureHeader() return pos-3; } - -// static function for stripping audio from a buffer containing an I Frame and its audio UINT Demuxer::stripAudio(UCHAR* buf, UINT len) { UINT read_pos = 0, write_pos = 0; @@ -325,8 +323,8 @@ UINT Demuxer::stripAudio(UCHAR* buf, UINT len) pattern = (buf[0] << 16) | (buf[1] << 8) | (buf[2]); while (read_pos + 7 <= len) { - pattern = ((pattern << 8) & 0xFFFFFFFF) | buf[read_pos+3]; - if (pattern < 0x000001E0 || pattern > 0x000001EF) + pattern = ((pattern & 0xFFFFFF) << 8) | buf[read_pos+3]; + if (pattern < 0x100|PESTYPE_VID0 || pattern > 0x100|PESTYPE_VIDMAX) read_pos++; else { diff --git a/demuxer.h b/demuxer.h index ecfc011..d168dd0 100644 --- a/demuxer.h +++ b/demuxer.h @@ -95,7 +95,9 @@ protected: ASPECT_16_9 = 3 }; - // Strip audio packets from buffer, leaving video only *static function* + // Remove all data from a buffer apart from video PES packets. + // Returns the length of the reduced data. + // *static function* static UINT stripAudio(UCHAR* buf, UINT len); protected: -- 2.39.5