diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-08-16 23:43:29 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-08-16 23:43:29 +0000 |
| commit | 34e6431eb2c9fcfe1dd9ecf310970a257609c64a (patch) | |
| tree | 8586e71d839397843f7225f8591785b6071e8454 /lib/dvb | |
| parent | c606126c3efaec7e3fdf1283fc37dfb7140bee13 (diff) | |
| download | enigma2-34e6431eb2c9fcfe1dd9ecf310970a257609c64a.tar.gz enigma2-34e6431eb2c9fcfe1dd9ecf310970a257609c64a.zip | |
add support for radiotext (python gui component missing yet)
Diffstat (limited to 'lib/dvb')
| -rw-r--r-- | lib/dvb/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/dvb/pesparse.cpp | 12 | ||||
| -rw-r--r-- | lib/dvb/pesparse.h | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/lib/dvb/Makefile.am b/lib/dvb/Makefile.am index e5b14f38..98f4030a 100644 --- a/lib/dvb/Makefile.am +++ b/lib/dvb/Makefile.am @@ -6,5 +6,5 @@ noinst_LIBRARIES = libenigma_dvb.a libenigma_dvb_a_SOURCES = dvb.cpp demux.cpp frontend.cpp esection.cpp db.cpp \ sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp rotor_calc.cpp \ epgcache.cpp dvbtime.cpp metaparser.cpp volume.cpp tstools.cpp pvrparse.cpp \ - pesparse.cpp teletext.cpp + pesparse.cpp teletext.cpp radiotext.cpp diff --git a/lib/dvb/pesparse.cpp b/lib/dvb/pesparse.cpp index 30e05894..da50c040 100644 --- a/lib/dvb/pesparse.cpp +++ b/lib/dvb/pesparse.cpp @@ -12,9 +12,10 @@ ePESParser::ePESParser() setStreamID(0); /* must be overridden */ } -void ePESParser::setStreamID(unsigned char id) +void ePESParser::setStreamID(unsigned char id, unsigned char id_mask) { m_header[3] = id; + m_stream_id_mask = id_mask; } void ePESParser::processData(const __u8 *p, int len) @@ -43,16 +44,21 @@ void ePESParser::processData(const __u8 *p, int len) } else { if (m_pes_position < 4) - if (*p != m_header[m_pes_position]) + { + unsigned char ch = *p; + if (m_pes_position == 3) + ch &= m_stream_id_mask; + if (ch != 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 */ + while (m_header[m_pes_position] == ch) /* guaranteed to stop at the old m_pes_position */ m_pes_position++; p++; len--; continue; } + } m_pes_buffer[m_pes_position++] = *p++; len--; if (m_pes_position == 6) { diff --git a/lib/dvb/pesparse.h b/lib/dvb/pesparse.h index 2966b721..51fab2db 100644 --- a/lib/dvb/pesparse.h +++ b/lib/dvb/pesparse.h @@ -7,7 +7,7 @@ class ePESParser { public: ePESParser(); - void setStreamID(unsigned char id); + void setStreamID(unsigned char id, unsigned char id_mask=0xff); void processData(const __u8 *data, int len); virtual void processPESPacket(__u8 *pkt, int len) = 0; virtual ~ePESParser() { } @@ -15,6 +15,7 @@ private: unsigned char m_pes_buffer[65536]; int m_pes_position, m_pes_length; unsigned char m_header[4]; + unsigned char m_stream_id_mask; }; #endif |
