From 4c7302685f04c453116112e3e0874d8b98420589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 5 Jan 2008 02:01:31 +0100 Subject: Update to the new crc API from FFmpeg. Note that I had to add a class pointer to demux_ts otherwise I would have to initialise it in the plugin structures (wasting space). --- src/input/input_dvb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/input/input_dvb.c') diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 9f53d6b90..51e4d47aa 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -298,6 +298,8 @@ typedef struct { int numchannels; char *autoplaylist[MAX_AUTOCHANNELS]; + + const AVCRC *av_crc; } dvb_input_class_t; typedef struct { @@ -2453,9 +2455,6 @@ static void ts_rewrite_packets (dvb_input_plugin_t *this, unsigned char * origin originalPkt+=data_offset; if (pid == 0 && sync_byte==0x47) { - if ( ! *av_crc04C11DB7 ) - av_crc_init(av_crc04C11DB7, 0, 32, AV_CRC_32_IEEE, sizeof(AVCRC)*257); - unsigned long crc; originalPkt[3]=13; /* section length including CRC - first 3 bytes */ @@ -2467,7 +2466,7 @@ static void ts_rewrite_packets (dvb_input_plugin_t *this, unsigned char * origin originalPkt[11]=(this->channels[this->channel].pmtpid >> 8) & 0xff; originalPkt[12]=this->channels[this->channel].pmtpid & 0xff; - crc = av_crc(av_crc04C11DB7, 0xffffffff, originalPkt+1, 12); + crc = av_crc(this->class->av_crc, 0xffffffff, originalPkt+1, 12); originalPkt[13]=(crc>>24) & 0xff; originalPkt[14]=(crc>>16) & 0xff; @@ -3268,6 +3267,8 @@ static void *init_class (xine_t *xine, void *data) { this->mrls[4] = "dvba://"; this->mrls[5] = 0; + this->av_crc = av_crc_get_table(AV_CRC_32_IEEE); + xprintf(this->xine,XINE_VERBOSITY_DEBUG,"init class succeeded\n"); /* Enable remembering of last watched channel */ -- cgit v1.2.3