From f02b1a3eb43f6ff0de4c3ee8295cd0f86e0fc3b3 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Wed, 15 Nov 2006 12:37:33 +0000 Subject: [PATCH] Generalise Demuxer::findPTS() to include audio --- demuxer.h | 2 +- demuxervdr.cc | 6 +++--- demuxervdr.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demuxer.h b/demuxer.h index d168dd0..ca32c1e 100644 --- a/demuxer.h +++ b/demuxer.h @@ -77,7 +77,7 @@ protected: bool writeVideo(); virtual int scan(UCHAR* buf, int len) = 0; - virtual int findVideoPTS(UCHAR* buf, int len, ULLONG* dest) = 0; + virtual int findPTS(UCHAR* buf, int len, ULLONG* dest) = 0; virtual int put(UCHAR* buf, int len) = 0; virtual void setFrameNum(ULONG frame) {} virtual ULONG getFrameNumFromPTS(ULLONG pts) {return 0;} diff --git a/demuxervdr.cc b/demuxervdr.cc index 9444b5b..f37ab6b 100644 --- a/demuxervdr.cc +++ b/demuxervdr.cc @@ -95,18 +95,18 @@ int DemuxerVDR::scan(UCHAR *buf, int len) return ret; } -int DemuxerVDR::findVideoPTS(UCHAR* buf, int len, ULLONG* dest) +int DemuxerVDR::findPTS(UCHAR* buf, int len, ULLONG* dest) { while (len >= 14) { UINT pattern = *(UINT*)buf; buf++; len--; #if __BYTE_ORDER == __BIG_ENDIAN - if (pattern < (0x100 | PESTYPE_VID0) || + if (pattern < (0x100 | PESTYPE_AUD0) || pattern > (0x100 | PESTYPE_VIDMAX)) continue; #else if ((pattern & 0xFFFFFF) != 0x010000 || - pattern < ((UINT)PESTYPE_VID0 << 24) || + pattern < ((UINT)PESTYPE_AUD0 << 24) || pattern > ((UINT)PESTYPE_VIDMAX << 24)) continue; #endif if ((buf[5] & 0xC0) != 0x80) continue; diff --git a/demuxervdr.h b/demuxervdr.h index ff2d030..7c7a36e 100644 --- a/demuxervdr.h +++ b/demuxervdr.h @@ -39,7 +39,7 @@ class DemuxerVDR : public Demuxer void reset(); void flush(); int scan(UCHAR* buf, int len); - int findVideoPTS(UCHAR* buf, int len, ULLONG* dest); + int findPTS(UCHAR* buf, int len, ULLONG* dest); int put(UCHAR* buf, int len); void setFrameNum(ULONG frame); ULONG getFrameNumFromPTS(ULLONG pts); -- 2.39.5