diff options
Diffstat (limited to 'src/audio_dec')
| -rw-r--r-- | src/audio_dec/xine_a52_decoder.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/audio_dec/xine_a52_decoder.c b/src/audio_dec/xine_a52_decoder.c index 1a68af202..71adf176a 100644 --- a/src/audio_dec/xine_a52_decoder.c +++ b/src/audio_dec/xine_a52_decoder.c @@ -78,6 +78,7 @@ typedef struct { int disable_dynrng_compress; int enable_surround_downmix; + const AVCRC *av_crc; } a52dec_class_t; typedef struct a52dec_decoder_s { @@ -586,18 +587,15 @@ static void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->sync_state = 3; } else break; - case 3: { /* Ready for decode */ - if ( ! *av_crc8005 ) - av_crc_init(av_crc8005, 0, 16, AV_CRC_16, sizeof(AVCRC)*257); - - if (av_crc(av_crc8005, 0, &this->frame_buffer[2], this->frame_length - 2) != 0) { /* CRC16 failed */ - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52:a52 frame failed crc16 checksum.\n"); - current = sync_start; - this->pts = 0; - this->syncword = 0; - this->sync_state = 0; - break; - } + case 3: { /* Ready for decode */ + if (av_crc(this->class->av_crc, 0, &this->frame_buffer[2], this->frame_length - 2) != 0) { /* CRC16 failed */ + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52:a52 frame failed crc16 checksum.\n"); + current = sync_start; + this->pts = 0; + this->syncword = 0; + this->sync_state = 0; + break; + } } #if 0 a52dec_decode_frame (this, this->pts_list[0], buf->decoder_flags & BUF_FLAG_PREVIEW); @@ -799,6 +797,8 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.description = N_("liba52 based a52 audio decoder plugin"); this->decoder_class.dispose = default_audio_decoder_class_dispose; + this->av_crc = av_crc_get_table(AV_CRC_16_ANSI); + cfg = this->config = xine->config; this->a52_level = (float) cfg->register_range (cfg, "audio.a52.level", 100, |
