summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorFlorian Schirmer <devnull@localhost>2002-11-21 14:38:49 +0000
committerFlorian Schirmer <devnull@localhost>2002-11-21 14:38:49 +0000
commit4d5867274ac80c1bfaec3f7ecd81fe2d6dfc611d (patch)
tree3bdb8d97c4cf8c30630df8f033edd87fbc57ec92 /linux/drivers/media/dvb
parent77e61d06d1de8ca494d335557a58652723fab0da (diff)
downloadmediapointer-dvb-s2-4d5867274ac80c1bfaec3f7ecd81fe2d6dfc611d.tar.gz
mediapointer-dvb-s2-4d5867274ac80c1bfaec3f7ecd81fe2d6dfc611d.tar.bz2
CRC handling / seeding changes
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/compat.c2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c11
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/compat.c b/linux/drivers/media/dvb/dvb-core/compat.c
index 1eb20ab9b..65ca30cdf 100644
--- a/linux/drivers/media/dvb/dvb-core/compat.c
+++ b/linux/drivers/media/dvb/dvb-core/compat.c
@@ -149,5 +149,7 @@ u32 crc32_le (u32 crc, unsigned char const *data, size_t len)
return crc;
}
+EXPORT_SYMBOL(crc32_le);
+
#endif
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
index fb4865936..41afff5b0 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -122,10 +122,10 @@ void dvb_set_crc32(u8 *data, int length)
static
-u32 dvb_dmx_crc32 (struct dvb_demux_feed *dvbdmxfeed, u32 seed,
+u32 dvb_dmx_crc32 (struct dvb_demux_feed *dvbdmxfeed,
const u8 *src, size_t len)
{
- return crc32_le (seed, src, len);
+ return (dvbdmxfeed->feed.sec.crc_val = crc32_le (dvbdmxfeed->feed.sec.crc_val, src, len));
}
@@ -208,7 +208,7 @@ dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0;
if (sec->check_crc &&
- demux->check_crc32(dvbdmxfeed, ~0, sec->secbuf, sec->seclen))
+ demux->check_crc32(dvbdmxfeed, sec->secbuf, sec->seclen))
return -1;
do {
@@ -278,6 +278,9 @@ int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf)
count = 188 - p;
while (count) {
+
+ sec->crc_val = ~0;
+
if ((count>2) && // enough data to determine sec length?
((sec->seclen = section_length(buf+p)) <= count)) {
if (sec->seclen>4096)
@@ -320,6 +323,8 @@ int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf)
if (tmp>count)
return -1;
+ sec->crc_val = ~0;
+
demux->memcopy (feed, sec->secbuf + sec->secbufp, buf+p, tmp);
sec->seclen = section_length(sec->secbuf);
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.h b/linux/drivers/media/dvb/dvb-core/dvb_demux.h
index c32cb3388..7aa93503e 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.h
@@ -99,7 +99,7 @@ struct dvb_demux {
int (*start_feed) (struct dvb_demux_feed *);
int (*stop_feed) (struct dvb_demux_feed *);
int (*write_to_decoder) (struct dvb_demux_feed *, u8 *buf, size_t len);
- u32 (*check_crc32) (struct dvb_demux_feed *, u32 seed,
+ u32 (*check_crc32) (struct dvb_demux_feed *,
const u8 *buf, size_t len);
void (*memcopy) (struct dvb_demux_feed *, u8 *dst,
const u8 *src, size_t len);