Commit 36e03def authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

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 <lvqcl.mail@gmail.com>
parent 1930ae10
...@@ -88,7 +88,6 @@ struct FLAC__BitReader { ...@@ -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 */ unsigned crc16_align; /* the number of bits in the current consumed word that should not be CRC'd */
FLAC__BitReaderReadCallback read_callback; FLAC__BitReaderReadCallback read_callback;
void *client_data; void *client_data;
FLAC__CPUInfo cpu_info;
}; };
static inline void crc16_update_word_(FLAC__BitReader *br, uint32_t word) static inline void crc16_update_word_(FLAC__BitReader *br, uint32_t word)
...@@ -231,7 +230,7 @@ void FLAC__bitreader_delete(FLAC__BitReader *br) ...@@ -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); FLAC__ASSERT(0 != br);
...@@ -243,7 +242,6 @@ FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__Bi ...@@ -243,7 +242,6 @@ FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__Bi
return false; return false;
br->read_callback = rcb; br->read_callback = rcb;
br->client_data = cd; br->client_data = cd;
br->cpu_info = cpu;
return true; return true;
} }
......
...@@ -50,7 +50,7 @@ typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *b ...@@ -50,7 +50,7 @@ typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *b
*/ */
FLAC__BitReader *FLAC__bitreader_new(void); FLAC__BitReader *FLAC__bitreader_new(void);
void FLAC__bitreader_delete(FLAC__BitReader *br); 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)' */ void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */
FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br); FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br);
void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out); void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out);
......
...@@ -434,7 +434,7 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_( ...@@ -434,7 +434,7 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_(
/* from here on, errors are fatal */ /* 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; decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
return FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR; return FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment