diff options
Diffstat (limited to 'src/libxineadec')
-rw-r--r-- | src/libxineadec/Makefile.am | 4 | ||||
-rw-r--r-- | src/libxineadec/xine_a52_decoder.c | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/libxineadec/Makefile.am b/src/libxineadec/Makefile.am index a85497bbf..fc3a6ea51 100644 --- a/src/libxineadec/Makefile.am +++ b/src/libxineadec/Makefile.am @@ -76,8 +76,8 @@ xineplug_decode_mad_la_CFLAGS = $(AM_CFLAGS) $(LIBMAD_CFLAGS) xineplug_decode_a52_la_SOURCES = xine_a52_decoder.c xineplug_decode_a52_la_DEPENDENCIES = $(A52DEC_DEPS) -xineplug_decode_a52_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(A52DEC_LIBS) -lm -xineplug_decode_a52_la_CFLAGS = $(AM_CFLAGS) $(A52DEC_CFLAGS) +xineplug_decode_a52_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(A52DEC_LIBS) $(AVUTIL_LIBS) -lm +xineplug_decode_a52_la_CFLAGS = $(AM_CFLAGS) $(A52DEC_CFLAGS) $(AVUTIL_CFLAGS) xineplug_decode_faad_la_SOURCES = xine_faad_decoder.c xineplug_decode_faad_la_DEPENDENCIES = $(FAAD_DEPS) diff --git a/src/libxineadec/xine_a52_decoder.c b/src/libxineadec/xine_a52_decoder.c index 2d901d00a..c3fa5fa7a 100644 --- a/src/libxineadec/xine_a52_decoder.c +++ b/src/libxineadec/xine_a52_decoder.c @@ -62,7 +62,8 @@ #include "buffer.h" #include "xineutils.h" -#include "../../contrib/a52dec/crc.c" +/* libavutil from FFmpeg */ +#include <crc.h> #undef DEBUG_A52 #ifdef DEBUG_A52 @@ -420,8 +421,6 @@ static void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { uint8_t *end = buf->content + buf->size; uint8_t byte; int32_t n; - uint16_t crc16; - uint16_t crc16_result; lprintf ("decode data %d bytes of type %08x, pts=%"PRId64"\n", buf->size, buf->type, buf->pts); @@ -587,10 +586,11 @@ 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 */ - crc16 = (uint16_t) ((this->frame_buffer[2] << 8) | this->frame_buffer[3]) ; - crc16_result = crc16_block(&this->frame_buffer[2], this->frame_length - 2) ; /* frame_length */ - if (crc16_result != 0) { /* CRC16 failed */ + 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; @@ -598,6 +598,7 @@ static void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->sync_state = 0; break; } + } #if 0 a52dec_decode_frame (this, this->pts_list[0], buf->decoder_flags & BUF_FLAG_PREVIEW); #else |