diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-05-12 17:30:42 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-05-12 17:30:42 +0000 |
| commit | 62b5ec90e68742957e88889c2b3c606a8a536e09 (patch) | |
| tree | 8ea63a951c58ced66d753a48ecda6e77b3cf439c | |
| parent | d80bb0a6b9862171d9901b6b19347b5e9f6279cd (diff) | |
| download | enigma2-62b5ec90e68742957e88889c2b3c606a8a536e09.tar.gz enigma2-62b5ec90e68742957e88889c2b3c606a8a536e09.zip | |
match declaration to signal
| -rw-r--r-- | lib/dvb/pesparse.cpp | 13 | ||||
| -rw-r--r-- | lib/dvb/pesparse.h | 6 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/dvb/pesparse.cpp b/lib/dvb/pesparse.cpp index 7e05c96a..d96477be 100644 --- a/lib/dvb/pesparse.cpp +++ b/lib/dvb/pesparse.cpp @@ -1,3 +1,4 @@ +#include <lib/base/eerror.h> #include <lib/dvb/pesparse.h> #include <memory.h> @@ -16,8 +17,11 @@ void ePESParser::setStreamID(unsigned char id) m_header[3] = id; } -void ePESParser::processData(unsigned char *p, int len) +void ePESParser::processData(const __u8 *p, int len) { + int i; + eDebug("process %d bytes of pes data, %02x, %02x, %02x, %02x, %02x, %02x", len, p[0], p[1], p[2], p[3], p[4], p[5]); +#if 0 /* this is a state machine, handling arbitary amounts of pes-formatted data. */ while (len) { @@ -40,9 +44,12 @@ void ePESParser::processData(unsigned char *p, int len) } else { if (m_pes_position < 4) - if (*p != "\x00\x00\x01\xbd"[m_pes_position]) + if (*p != m_header[m_pes_position]) { + eDebug("sync lost at %d (%02x)", m_pes_position, *p); m_pes_position = 0; + while (m_header[m_pes_position] == *p) /* guaranteed to stop at the old m_pes_position */ + m_pes_position++; p++; len--; continue; @@ -51,7 +58,9 @@ void ePESParser::processData(unsigned char *p, int len) if (m_pes_position == 6) { m_pes_length = ((m_pes_buffer[4] << 8) | m_pes_buffer[5]) + 6; + eDebug("pes length: %d", m_pes_length); } } } +#endif } diff --git a/lib/dvb/pesparse.h b/lib/dvb/pesparse.h index f2f59f94..1b49ddde 100644 --- a/lib/dvb/pesparse.h +++ b/lib/dvb/pesparse.h @@ -1,13 +1,15 @@ #ifndef __lib_dvb_pesparse_h #define __lib_dvb_pesparse_h +#include <asm/types.h> + class ePESParser { public: ePESParser(); void setStreamID(unsigned char id); - void processData(unsigned char *data, int len); - virtual void processPESPacket(unsigned char *pkt, int len) = 0; + void processData(const __u8 *data, int len); + virtual void processPESPacket(__u8 *pkt, int len) = 0; private: unsigned char m_pes_buffer[65536]; int m_pes_position, m_pes_length; |
