From 36e03def10c8d35508c33969bf8349cf5bd57dfd Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 27 Jul 2014 21:21:46 +1000 Subject: [PATCH] libFLAC/bitreader : Remove un-needed FLAC__CPUInfo field from FLAC__BitReader. In FLAC 1.2.0, a new field 'FLAC__CPUInfo cpu_info' was added to the FLAC__BitReader struct. It became useless in 1.3.0 because of various bitreader optimizations. Patch-from: lvqcl --- src/libFLAC/bitreader.c | 4 +--- src/libFLAC/include/private/bitreader.h | 2 +- src/libFLAC/stream_decoder.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index d25d0b2a..07e4e327 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -88,7 +88,6 @@ struct FLAC__BitReader { unsigned crc16_align; /* the number of bits in the current consumed word that should not be CRC'd */ FLAC__BitReaderReadCallback read_callback; void *client_data; - FLAC__CPUInfo cpu_info; }; static inline void crc16_update_word_(FLAC__BitReader *br, uint32_t word) @@ -231,7 +230,7 @@ void FLAC__bitreader_delete(FLAC__BitReader *br) * ***********************************************************************/ -FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd) +FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__BitReaderReadCallback rcb, void *cd) { FLAC__ASSERT(0 != br); @@ -243,7 +242,6 @@ FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__Bi return false; br->read_callback = rcb; br->client_data = cd; - br->cpu_info = cpu; return true; } diff --git a/src/libFLAC/include/private/bitreader.h b/src/libFLAC/include/private/bitreader.h index c43c3358..ebdabb4a 100644 --- a/src/libFLAC/include/private/bitreader.h +++ b/src/libFLAC/include/private/bitreader.h @@ -50,7 +50,7 @@ typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *b */ FLAC__BitReader *FLAC__bitreader_new(void); void FLAC__bitreader_delete(FLAC__BitReader *br); -FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd); +FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__BitReaderReadCallback rcb, void *cd); void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */ FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br); void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out); diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 05deac0c..e238eacc 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -434,7 +434,7 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_( /* from here on, errors are fatal */ - if(!FLAC__bitreader_init(decoder->private_->input, decoder->private_->cpuinfo, read_callback_, decoder)) { + if(!FLAC__bitreader_init(decoder->private_->input, read_callback_, decoder)) { decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; return FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR; }