diff options
author | Jamie Honan <devnull@localhost> | 2003-10-13 00:34:51 +0000 |
---|---|---|
committer | Jamie Honan <devnull@localhost> | 2003-10-13 00:34:51 +0000 |
commit | 1c6e3ff694080be6e59ec3b2dc75691e2094b15b (patch) | |
tree | c200544fb01e9ed205b61037745c65d9cf072de9 /linux | |
parent | 00f69326ca0e6167f36db7b9998923be37954396 (diff) | |
download | mediapointer-dvb-s2-1c6e3ff694080be6e59ec3b2dc75691e2094b15b.tar.gz mediapointer-dvb-s2-1c6e3ff694080be6e59ec3b2dc75691e2094b15b.tar.bz2 |
Added Brad Campbell's dvb_dmx_swfilter_204 routine to handle data from
DST-CI.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_demux.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index 29108599d..fa73e43b8 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -446,6 +446,50 @@ bailout: spin_unlock(&demux->lock); } +void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) +{ + int p = 0,i, j; + u8 tmppack[188]; + spin_lock(&demux->lock); + + if ((i = demux->tsbufp)) { + if (count < (j=204-i)) { + memcpy(&demux->tsbuf[i], buf, count); + demux->tsbufp += count; + goto bailout; + } + memcpy(&demux->tsbuf[i], buf, j); + if ((demux->tsbuf[0] == 0x47)|(demux->tsbuf[0]==0xB8)) { + memcpy(tmppack, demux->tsbuf, 188); + if (tmppack[0] == 0xB8) tmppack[0] = 0x47; + dvb_dmx_swfilter_packet(demux, tmppack); + } + demux->tsbufp = 0; + p += j; + } + + while (p < count) { + if ((buf[p] == 0x47)|(buf[p] == 0xB8)) { + if (count-p >= 204) { + memcpy(tmppack, buf+p, 188); + if (tmppack[0] == 0xB8) tmppack[0] = 0x47; + dvb_dmx_swfilter_packet(demux, tmppack); + p += 204; + } else { + i = count-p; + memcpy(demux->tsbuf, buf+p, i); + demux->tsbufp=i; + goto bailout; + } + } else { + p++; + } + } + +bailout: + spin_unlock(&demux->lock); +} + static struct dvb_demux_filter * dvb_dmx_filter_alloc(struct dvb_demux *demux) { |