summaryrefslogtreecommitdiff
path: root/src/input/input_dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/input_dvb.c')
-rw-r--r--src/input/input_dvb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 1151d9a81..9a40b1996 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -100,6 +100,9 @@
#endif
#include <ctype.h>
+/* libavutil from FFmpeg */
+#include <crc.h>
+
/* XDG */
#include <basedir.h>
@@ -2445,6 +2448,9 @@ 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 */
@@ -2456,7 +2462,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= _x_compute_crc32 (originalPkt+1, 12, 0xffffffff);
+ crc = av_crc(av_crc04C11DB7, 0xffffffff, originalPkt+1, 12);
originalPkt[13]=(crc>>24) & 0xff;
originalPkt[14]=(crc>>16) & 0xff;