CRC32 should use and return 32bit values

This commit is contained in:
Moritz Bunkus 2011-08-14 13:21:18 +02:00
parent ddc563c575
commit 8d8b9afa16
2 changed files with 3 additions and 3 deletions

View File

@ -285,11 +285,11 @@ static const uint32_t crc_table[256] = {
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
unsigned long
uint32_t
mpeg_ts_reader_c::calculate_crc32(unsigned char *data,
int len) {
register int i;
unsigned long crc = 0xffffffff;
uint32_t crc = 0xffffffff;
for (i = 0; i < len; i++)
crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *data++) & 0xff];

View File

@ -200,7 +200,7 @@ public:
virtual bool parse_packet(int id, unsigned char *buf);
private:
unsigned long calculate_crc32(unsigned char *data, int len);
uint32_t calculate_crc32(unsigned char *data, int len);
int parse_pat(unsigned char *pat);
int parse_pmt(unsigned char *pmt);
file_status_e finish();