diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-04 23:09:58 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-04 23:09:58 +0000 |
commit | 3abe5fbdc4169047421e9e8794a8f190d794b929 (patch) | |
tree | 69954b6566185ceebcd2e462cdfa6c68f0393b48 /libavformat | |
parent | 83a0d3878c54b84b21c12be1981bd30096f278f4 (diff) | |
download | ffmpeg-3abe5fbdc4169047421e9e8794a8f190d794b929.tar.gz |
improve CRC API
- don't export any global var
- provide either generated or hardcoded tables
Originally committed as revision 11409 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aviobuf.c | 2 | ||||
-rw-r--r-- | libavformat/mpegts.c | 3 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 507003184e..3917270b1d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -318,7 +318,7 @@ static void fill_buffer(ByteIOContext *s) } unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len){ - return av_crc(av_crc04C11DB7, checksum, buf, len); + return av_crc(av_crc_get_table(AV_CRC_32_IEEE), checksum, buf, len); } unsigned long get_checksum(ByteIOContext *s){ diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index b89bb4421f..b3ab16de0f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -262,7 +262,8 @@ static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1, if (tss->section_h_size != -1 && tss->section_index >= tss->section_h_size) { tss->end_of_section_reached = 1; if (!tss->check_crc || - av_crc(av_crc04C11DB7, -1, tss->section_buf, tss->section_h_size) == 0) + av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, + tss->section_buf, tss->section_h_size) == 0) tss->section_cb(tss1, tss->section_buf, tss->section_h_size); } } diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index b5a63e87ed..49d29aa2b9 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -43,7 +43,7 @@ static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) unsigned char *q; int first, b, len1, left; - crc = bswap_32(av_crc(av_crc04C11DB7, -1, buf, len - 4)); + crc = bswap_32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, len - 4)); buf[len - 4] = (crc >> 24) & 0xff; buf[len - 3] = (crc >> 16) & 0xff; buf[len - 2] = (crc >> 8) & 0xff; |