summaryrefslogtreecommitdiff
path: root/src/audio_dec
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-01-05 02:01:31 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-01-05 02:01:31 +0100
commit4c7302685f04c453116112e3e0874d8b98420589 (patch)
treeca5b87f78c186c8e902fc2b31be62a6b168bc634 /src/audio_dec
parentab7525dbd45742cd9b583c1fb1cc4ff2443414e5 (diff)
downloadxine-lib-4c7302685f04c453116112e3e0874d8b98420589.tar.gz
xine-lib-4c7302685f04c453116112e3e0874d8b98420589.tar.bz2
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).
Diffstat (limited to 'src/audio_dec')
-rw-r--r--src/audio_dec/xine_a52_decoder.c24
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,