minor formatting

This commit is contained in:
Josh Coalson 2002-07-31 06:58:16 +00:00
parent 6e78c0d859
commit 570db86717
4 changed files with 378 additions and 378 deletions

View File

@ -134,8 +134,8 @@ static FLAC__bool bitbuffer_resize_(FLAC__BitBuffer *bb, unsigned new_capacity)
{
FLAC__blurb *new_buffer;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
if(bb->capacity == new_capacity)
return true;
@ -155,7 +155,7 @@ static FLAC__bool bitbuffer_resize_(FLAC__BitBuffer *bb, unsigned new_capacity)
bb->consumed_bits = 0;
bb->total_consumed_bits = FLAC__BLURBS_TO_BITS(new_capacity);
}
free(bb->buffer); /* we've already asserted above that (bb->buffer != 0) */
free(bb->buffer); /* we've already asserted above that (0 != bb->buffer) */
bb->buffer = new_buffer;
bb->capacity = new_capacity;
return true;
@ -173,8 +173,8 @@ static FLAC__bool bitbuffer_grow_(FLAC__BitBuffer *bb, unsigned min_blurbs_to_ad
static FLAC__bool bitbuffer_ensure_size_(FLAC__BitBuffer *bb, unsigned bits_to_add)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
if(FLAC__BLURBS_TO_BITS(bb->capacity) < bb->total_bits + bits_to_add)
return bitbuffer_grow_(bb, (bits_to_add >> FLAC__BITS_PER_BLURB_LOG2) + 2);
@ -264,7 +264,7 @@ FLAC__BitBuffer *FLAC__bitbuffer_new()
void FLAC__bitbuffer_delete(FLAC__BitBuffer *bb)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(0 != bb);
FLAC__bitbuffer_free(bb);
free(bb);
@ -278,7 +278,7 @@ void FLAC__bitbuffer_delete(FLAC__BitBuffer *bb)
FLAC__bool FLAC__bitbuffer_init(FLAC__BitBuffer *bb)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(0 != bb);
bb->buffer = 0;
bb->capacity = 0;
@ -290,7 +290,7 @@ FLAC__bool FLAC__bitbuffer_init(FLAC__BitBuffer *bb)
FLAC__bool FLAC__bitbuffer_init_from(FLAC__BitBuffer *bb, const FLAC__byte buffer[], unsigned bytes)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(bytes > 0);
if(!FLAC__bitbuffer_init(bb))
@ -299,7 +299,7 @@ FLAC__bool FLAC__bitbuffer_init_from(FLAC__BitBuffer *bb, const FLAC__byte buffe
if(!bitbuffer_ensure_size_(bb, bytes << 3))
return false;
FLAC__ASSERT(buffer != 0);
FLAC__ASSERT(0 != buffer);
/* @@@ WATCHOUT: code currently only works for 8-bits-per-blurb inclusive-or big-endian: */
memcpy((FLAC__byte*)bb->buffer, buffer, sizeof(FLAC__byte)*bytes);
bb->blurbs = bytes / FLAC__BYTES_PER_BLURB;
@ -312,8 +312,8 @@ FLAC__bool FLAC__bitbuffer_concatenate_aligned(FLAC__BitBuffer *dest, const FLAC
{
unsigned bits_to_add = src->total_bits - src->total_consumed_bits;
FLAC__ASSERT(dest != 0);
FLAC__ASSERT(src != 0);
FLAC__ASSERT(0 != dest);
FLAC__ASSERT(0 != src);
if(bits_to_add == 0)
return true;
@ -342,9 +342,9 @@ FLAC__bool FLAC__bitbuffer_concatenate_aligned(FLAC__BitBuffer *dest, const FLAC
void FLAC__bitbuffer_free(FLAC__BitBuffer *bb)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(0 != bb);
if(bb->buffer != 0)
if(0 != bb->buffer)
free(bb->buffer);
bb->buffer = 0;
bb->capacity = 0;
@ -371,10 +371,10 @@ FLAC__bool FLAC__bitbuffer_clear(FLAC__BitBuffer *bb)
FLAC__bool FLAC__bitbuffer_clone(FLAC__BitBuffer *dest, const FLAC__BitBuffer *src)
{
FLAC__ASSERT(dest != 0);
FLAC__ASSERT(dest->buffer != 0);
FLAC__ASSERT(src != 0);
FLAC__ASSERT(src->buffer != 0);
FLAC__ASSERT(0 != dest);
FLAC__ASSERT(0 != dest->buffer);
FLAC__ASSERT(0 != src);
FLAC__ASSERT(0 != src->buffer);
if(dest->capacity < src->capacity)
if(!bitbuffer_resize_(dest, src->capacity))
@ -392,8 +392,8 @@ FLAC__bool FLAC__bitbuffer_clone(FLAC__BitBuffer *dest, const FLAC__BitBuffer *s
void FLAC__bitbuffer_reset_read_crc16(FLAC__BitBuffer *bb, FLAC__uint16 seed)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT((bb->consumed_bits & 7) == 0);
bb->read_crc16 = seed;
@ -408,8 +408,8 @@ void FLAC__bitbuffer_reset_read_crc16(FLAC__BitBuffer *bb, FLAC__uint16 seed)
FLAC__uint16 FLAC__bitbuffer_get_read_crc16(FLAC__BitBuffer *bb)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT((bb->bits & 7) == 0);
FLAC__ASSERT((bb->consumed_bits & 7) == 0);
@ -539,8 +539,8 @@ FLAC__bool FLAC__bitbuffer_write_zeroes(FLAC__BitBuffer *bb, unsigned bits)
{
unsigned n;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
if(bits == 0)
return true;
@ -564,8 +564,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_write_raw_uint32(FLAC__BitBuffer *bb, FL
{
unsigned n, k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 32);
if(bits == 0)
@ -655,8 +655,8 @@ FLAC__bool FLAC__bitbuffer_write_raw_uint64(FLAC__BitBuffer *bb, FLAC__uint64 va
};
unsigned n, k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 64);
if(bits == 0)
@ -844,8 +844,8 @@ FLAC__bool FLAC__bitbuffer_write_symmetric_rice_signed(FLAC__BitBuffer *bb, int
unsigned total_bits, interesting_bits, msbs;
FLAC__uint32 pattern;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
/* init pattern with the unary end bit and the sign bit */
@ -883,8 +883,8 @@ FLAC__bool FLAC__bitbuffer_write_symmetric_rice_signed_guarded(FLAC__BitBuffer *
unsigned total_bits, interesting_bits, msbs;
FLAC__uint32 pattern;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
*overflow = false;
@ -928,8 +928,8 @@ FLAC__bool FLAC__bitbuffer_write_symmetric_rice_signed_escape(FLAC__BitBuffer *b
unsigned total_bits, val_bits;
FLAC__uint32 pattern;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
val_bits = FLAC__bitmath_silog2(val);
@ -964,8 +964,8 @@ FLAC__bool FLAC__bitbuffer_write_rice_signed(FLAC__BitBuffer *bb, int val, unsig
unsigned total_bits, interesting_bits, msbs, uval;
FLAC__uint32 pattern;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 30);
/* fold signed to unsigned */
@ -1005,8 +1005,8 @@ FLAC__bool FLAC__bitbuffer_write_rice_signed_guarded(FLAC__BitBuffer *bb, int va
unsigned total_bits, interesting_bits, msbs, uval;
FLAC__uint32 pattern;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 30);
*overflow = false;
@ -1053,8 +1053,8 @@ FLAC__bool FLAC__bitbuffer_write_golomb_signed(FLAC__BitBuffer *bb, int val, uns
unsigned total_bits, msbs, uval;
unsigned k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter > 0);
/* fold signed to unsigned */
@ -1121,8 +1121,8 @@ FLAC__bool FLAC__bitbuffer_write_golomb_unsigned(FLAC__BitBuffer *bb, unsigned u
unsigned total_bits, msbs;
unsigned k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter > 0);
k = FLAC__bitmath_ilog2(parameter);
@ -1179,8 +1179,8 @@ FLAC__bool FLAC__bitbuffer_write_utf8_uint32(FLAC__BitBuffer *bb, FLAC__uint32 v
{
FLAC__bool ok = 1;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(!(val & 0x80000000)); /* this version only handles 31 bits */
@ -1225,8 +1225,8 @@ FLAC__bool FLAC__bitbuffer_write_utf8_uint64(FLAC__BitBuffer *bb, FLAC__uint64 v
{
FLAC__bool ok = 1;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(!(val & 0xFFFFFFF000000000)); /* this version only handles 36 bits */
@ -1288,8 +1288,8 @@ FLAC__bool FLAC__bitbuffer_zero_pad_to_byte_boundary(FLAC__BitBuffer *bb)
FLAC__bool FLAC__bitbuffer_peek_bit(FLAC__BitBuffer *bb, unsigned *val, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
{
/* to avoid a drastic speed penalty we don't:
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bb->bits == 0);
*/
@ -1308,8 +1308,8 @@ FLAC__bool FLAC__bitbuffer_peek_bit(FLAC__BitBuffer *bb, unsigned *val, FLAC__bo
FLAC__bool FLAC__bitbuffer_read_bit(FLAC__BitBuffer *bb, unsigned *val, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
{
/* to avoid a drastic speed penalty we don't:
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bb->bits == 0);
*/
@ -1335,8 +1335,8 @@ FLAC__bool FLAC__bitbuffer_read_bit(FLAC__BitBuffer *bb, unsigned *val, FLAC__bo
FLAC__bool FLAC__bitbuffer_read_bit_to_uint32(FLAC__BitBuffer *bb, FLAC__uint32 *val, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
{
/* to avoid a drastic speed penalty we don't:
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bb->bits == 0);
*/
@ -1363,8 +1363,8 @@ FLAC__bool FLAC__bitbuffer_read_bit_to_uint32(FLAC__BitBuffer *bb, FLAC__uint32
FLAC__bool FLAC__bitbuffer_read_bit_to_uint64(FLAC__BitBuffer *bb, FLAC__uint64 *val, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
{
/* to avoid a drastic speed penalty we don't:
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bb->bits == 0);
*/
@ -1393,8 +1393,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_read_raw_uint32(FLAC__BitBuffer *bb, FLA
{
unsigned i;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 32);
@ -1410,8 +1410,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_read_raw_uint32(FLAC__BitBuffer *bb, FLA
unsigned i, bits_ = bits;
FLAC__uint32 v = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 32);
FLAC__ASSERT((bb->capacity*FLAC__BITS_PER_BLURB) * 2 >= bits);
@ -1495,8 +1495,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_int32(FLAC__BitBuffer *bb, FLAC__int32 *val,
unsigned i;
FLAC__uint32 v;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 32);
@ -1528,8 +1528,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_int32(FLAC__BitBuffer *bb, FLAC__int32 *val,
unsigned i, bits_ = bits;
FLAC__uint32 v = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 32);
FLAC__ASSERT((bb->capacity*FLAC__BITS_PER_BLURB) * 2 >= bits);
@ -1624,8 +1624,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_uint64(FLAC__BitBuffer *bb, FLAC__uint64 *va
{
unsigned i;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 64);
@ -1641,8 +1641,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_uint64(FLAC__BitBuffer *bb, FLAC__uint64 *va
unsigned i, bits_ = bits;
FLAC__uint64 v = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 64);
FLAC__ASSERT((bb->capacity*FLAC__BITS_PER_BLURB) * 2 >= bits);
@ -1713,8 +1713,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_int64(FLAC__BitBuffer *bb, FLAC__int64 *val,
unsigned i;
FLAC__uint64 v;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 64);
@ -1740,8 +1740,8 @@ FLAC__bool FLAC__bitbuffer_read_raw_int64(FLAC__BitBuffer *bb, FLAC__int64 *val,
unsigned i, bits_ = bits;
FLAC__uint64 v = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(bits <= 64);
FLAC__ASSERT((bb->capacity*FLAC__BITS_PER_BLURB) * 2 >= bits);
@ -1846,8 +1846,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_read_raw_uint32_little_endian(FLAC__BitB
FLAC__bool FLAC__bitbuffer_read_byte_block_aligned(FLAC__BitBuffer *bb, FLAC__byte *val, unsigned nvals, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
{
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(FLAC__bitbuffer_is_byte_aligned(bb));
FLAC__ASSERT(FLAC__bitbuffer_is_consumed_byte_aligned(bb));
#if FLAC__BITS_PER_BLURB == 8
@ -1880,8 +1880,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_read_unary_unsigned(FLAC__BitBuffer *bb,
{
unsigned bit, val_ = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
while(1) {
if(!FLAC__bitbuffer_read_bit(bb, &bit, read_callback, client_data))
@ -1900,8 +1900,8 @@ FLaC__INLINE FLAC__bool FLAC__bitbuffer_read_unary_unsigned(FLAC__BitBuffer *bb,
unsigned total_blurbs_ = (bb->total_bits + (FLAC__BITS_PER_BLURB-1)) / FLAC__BITS_PER_BLURB;
FLAC__blurb b;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
#if FLAC__BITS_PER_BLURB > 8
if(bb->bits == 0 || bb->consumed_blurbs < bb->blurbs) { /*@@@ comment on why this is here*/
@ -1983,8 +1983,8 @@ FLAC__bool FLAC__bitbuffer_read_symmetric_rice_signed(FLAC__BitBuffer *bb, int *
{
FLAC__uint32 sign = 0, lsbs = 0, msbs = 0;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
/* read the unary MSBs and end bit */
@ -2013,8 +2013,8 @@ FLAC__bool FLAC__bitbuffer_read_rice_signed(FLAC__BitBuffer *bb, int *val, unsig
FLAC__uint32 lsbs = 0, msbs = 0;
unsigned uval;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
/* read the unary MSBs and end bit */
@ -2044,8 +2044,8 @@ FLAC__bool FLAC__bitbuffer_read_rice_signed_block(FLAC__BitBuffer *bb, int vals[
FLAC__blurb blurb, save_blurb;
unsigned state = 0; /* 0 = getting unary MSBs, 1 = getting binary LSBs */
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
FLAC__ASSERT(parameter <= 31);
if(nvals == 0)
@ -2249,8 +2249,8 @@ FLAC__bool FLAC__bitbuffer_read_golomb_signed(FLAC__BitBuffer *bb, int *val, uns
FLAC__uint32 lsbs = 0, msbs = 0;
unsigned bit, uval, k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
k = FLAC__bitmath_ilog2(parameter);
@ -2293,8 +2293,8 @@ FLAC__bool FLAC__bitbuffer_read_golomb_unsigned(FLAC__BitBuffer *bb, unsigned *v
FLAC__uint32 lsbs, msbs = 0;
unsigned bit, k;
FLAC__ASSERT(bb != 0);
FLAC__ASSERT(bb->buffer != 0);
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
k = FLAC__bitmath_ilog2(parameter);

View File

@ -38,7 +38,7 @@
*
***********************************************************************/
static void file_decoder_set_defaults_(FLAC__FileDecoder *decoder);
static void set_defaults_(FLAC__FileDecoder *decoder);
static FILE *get_binary_stdin_();
static FLAC__SeekableStreamDecoderReadStatus read_callback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
static FLAC__SeekableStreamDecoderSeekStatus seek_callback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
@ -122,7 +122,7 @@ FLAC__FileDecoder *FLAC__file_decoder_new()
decoder->private_->file = 0;
file_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__FILE_DECODER_UNINITIALIZED;
@ -131,10 +131,10 @@ FLAC__FileDecoder *FLAC__file_decoder_new()
void FLAC__file_decoder_delete(FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
(void)FLAC__file_decoder_finish(decoder);
@ -153,7 +153,7 @@ void FLAC__file_decoder_delete(FLAC__FileDecoder *decoder)
FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return decoder->protected_->state = FLAC__FILE_DECODER_ALREADY_INITIALIZED;
@ -187,24 +187,24 @@ FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder)
FLAC__bool FLAC__file_decoder_finish(FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__FILE_DECODER_UNINITIALIZED)
return true;
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->private_->file != 0 && decoder->private_->file != stdin) {
if(0 != decoder->private_->file && decoder->private_->file != stdin) {
fclose(decoder->private_->file);
decoder->private_->file = 0;
}
if(decoder->private_->filename != 0) {
if(0 != decoder->private_->filename) {
free(decoder->private_->filename);
decoder->private_->filename = 0;
}
file_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__FILE_DECODER_UNINITIALIZED;
@ -213,10 +213,10 @@ FLAC__bool FLAC__file_decoder_finish(FLAC__FileDecoder *decoder)
FLAC__bool FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder *decoder, FLAC__bool value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_md5_checking(decoder->private_->seekable_stream_decoder, value);
@ -224,10 +224,10 @@ FLAC__bool FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder *decoder, FLAC_
FLAC__bool FLAC__file_decoder_set_filename(FLAC__FileDecoder *decoder, const char *value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(value != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != value);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
if(0 != decoder->private_->filename) {
@ -246,9 +246,9 @@ FLAC__bool FLAC__file_decoder_set_filename(FLAC__FileDecoder *decoder, const cha
FLAC__bool FLAC__file_decoder_set_write_callback(FLAC__FileDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
decoder->private_->write_callback = value;
@ -257,9 +257,9 @@ FLAC__bool FLAC__file_decoder_set_write_callback(FLAC__FileDecoder *decoder, FLA
FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
decoder->private_->metadata_callback = value;
@ -268,9 +268,9 @@ FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder,
FLAC__bool FLAC__file_decoder_set_error_callback(FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
decoder->private_->error_callback = value;
@ -279,9 +279,9 @@ FLAC__bool FLAC__file_decoder_set_error_callback(FLAC__FileDecoder *decoder, voi
FLAC__bool FLAC__file_decoder_set_client_data(FLAC__FileDecoder *decoder, void *value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
decoder->private_->client_data = value;
@ -290,10 +290,10 @@ FLAC__bool FLAC__file_decoder_set_client_data(FLAC__FileDecoder *decoder, void *
FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_respond(decoder->private_->seekable_stream_decoder, type);
@ -301,10 +301,10 @@ FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, F
FLAC__bool FLAC__file_decoder_set_metadata_respond_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_respond_application(decoder->private_->seekable_stream_decoder, id);
@ -312,10 +312,10 @@ FLAC__bool FLAC__file_decoder_set_metadata_respond_application(FLAC__FileDecoder
FLAC__bool FLAC__file_decoder_set_metadata_respond_all(FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_respond_all(decoder->private_->seekable_stream_decoder);
@ -323,10 +323,10 @@ FLAC__bool FLAC__file_decoder_set_metadata_respond_all(FLAC__FileDecoder *decode
FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_ignore(decoder->private_->seekable_stream_decoder, type);
@ -334,10 +334,10 @@ FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FL
FLAC__bool FLAC__file_decoder_set_metadata_ignore_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_ignore_application(decoder->private_->seekable_stream_decoder, id);
@ -345,10 +345,10 @@ FLAC__bool FLAC__file_decoder_set_metadata_ignore_application(FLAC__FileDecoder
FLAC__bool FLAC__file_decoder_set_metadata_ignore_all(FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->seekable_stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->seekable_stream_decoder);
if(decoder->protected_->state != FLAC__FILE_DECODER_UNINITIALIZED)
return false;
return FLAC__seekable_stream_decoder_set_metadata_ignore_all(decoder->private_->seekable_stream_decoder);
@ -357,57 +357,57 @@ FLAC__bool FLAC__file_decoder_set_metadata_ignore_all(FLAC__FileDecoder *decoder
FLAC__FileDecoderState FLAC__file_decoder_get_state(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->state;
}
FLAC__bool FLAC__file_decoder_get_md5_checking(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_md5_checking(decoder->private_->seekable_stream_decoder);
}
unsigned FLAC__file_decoder_get_channels(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_channels(decoder->private_->seekable_stream_decoder);
}
FLAC__ChannelAssignment FLAC__file_decoder_get_channel_assignment(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_channel_assignment(decoder->private_->seekable_stream_decoder);
}
unsigned FLAC__file_decoder_get_bits_per_sample(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_bits_per_sample(decoder->private_->seekable_stream_decoder);
}
unsigned FLAC__file_decoder_get_sample_rate(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_sample_rate(decoder->private_->seekable_stream_decoder);
}
unsigned FLAC__file_decoder_get_blocksize(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__seekable_stream_decoder_get_blocksize(decoder->private_->seekable_stream_decoder);
}
FLAC__bool FLAC__file_decoder_process_whole_file(FLAC__FileDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->seekable_stream_decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__FILE_DECODER_END_OF_FILE;
@ -427,7 +427,7 @@ FLAC__bool FLAC__file_decoder_process_whole_file(FLAC__FileDecoder *decoder)
FLAC__bool FLAC__file_decoder_process_metadata(FLAC__FileDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->seekable_stream_decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__FILE_DECODER_END_OF_FILE;
@ -447,7 +447,7 @@ FLAC__bool FLAC__file_decoder_process_metadata(FLAC__FileDecoder *decoder)
FLAC__bool FLAC__file_decoder_process_one_frame(FLAC__FileDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->seekable_stream_decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__FILE_DECODER_END_OF_FILE;
@ -467,7 +467,7 @@ FLAC__bool FLAC__file_decoder_process_one_frame(FLAC__FileDecoder *decoder)
FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->seekable_stream_decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__FILE_DECODER_END_OF_FILE;
@ -486,7 +486,7 @@ FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decode
FLAC__bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, FLAC__uint64 sample)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(decoder->protected_->state == FLAC__FILE_DECODER_OK || decoder->protected_->state == FLAC__FILE_DECODER_END_OF_FILE);
if(decoder->private_->filename == 0) { /* means the file is stdin... */
@ -510,7 +510,7 @@ FLAC__bool FLAC__file_decoder_seek_absolute(FLAC__FileDecoder *decoder, FLAC__ui
*
***********************************************************************/
void file_decoder_set_defaults_(FLAC__FileDecoder *decoder)
void set_defaults_(FLAC__FileDecoder *decoder)
{
decoder->private_->filename = 0;
decoder->private_->write_callback = 0;

View File

@ -31,7 +31,7 @@
*
***********************************************************************/
static void seekable_stream_decoder_set_defaults_(FLAC__SeekableStreamDecoder *decoder);
static void set_defaults_(FLAC__SeekableStreamDecoder *decoder);
static FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
@ -145,7 +145,7 @@ FLAC__SeekableStreamDecoder *FLAC__seekable_stream_decoder_new()
return 0;
}
seekable_stream_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED;
@ -154,10 +154,10 @@ FLAC__SeekableStreamDecoder *FLAC__seekable_stream_decoder_new()
void FLAC__seekable_stream_decoder_delete(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
(void)FLAC__seekable_stream_decoder_finish(decoder);
@ -176,7 +176,7 @@ void FLAC__seekable_stream_decoder_delete(FLAC__SeekableStreamDecoder *decoder)
FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_init(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED;
@ -222,14 +222,14 @@ FLAC__bool FLAC__seekable_stream_decoder_finish(FLAC__SeekableStreamDecoder *dec
{
FLAC__bool md5_failed = false;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return true;
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
/* see the comment in FLAC__seekable_stream_decoder_init() as to why we
* always call MD5Final()
@ -243,7 +243,7 @@ FLAC__bool FLAC__seekable_stream_decoder_finish(FLAC__SeekableStreamDecoder *dec
md5_failed = true;
}
seekable_stream_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED;
@ -252,8 +252,8 @@ FLAC__bool FLAC__seekable_stream_decoder_finish(FLAC__SeekableStreamDecoder *dec
FLAC__bool FLAC__seekable_stream_decoder_set_md5_checking(FLAC__SeekableStreamDecoder *decoder, FLAC__bool value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->protected_->md5_checking = value;
@ -262,9 +262,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_md5_checking(FLAC__SeekableStreamDe
FLAC__bool FLAC__seekable_stream_decoder_set_read_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderReadStatus (*value)(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->read_callback = value;
@ -273,9 +273,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_read_callback(FLAC__SeekableStreamD
FLAC__bool FLAC__seekable_stream_decoder_set_seek_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderSeekStatus (*value)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->seek_callback = value;
@ -284,9 +284,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_seek_callback(FLAC__SeekableStreamD
FLAC__bool FLAC__seekable_stream_decoder_set_tell_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderTellStatus (*value)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->tell_callback = value;
@ -295,9 +295,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_tell_callback(FLAC__SeekableStreamD
FLAC__bool FLAC__seekable_stream_decoder_set_length_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__SeekableStreamDecoderLengthStatus (*value)(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->length_callback = value;
@ -306,9 +306,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_length_callback(FLAC__SeekableStrea
FLAC__bool FLAC__seekable_stream_decoder_set_eof_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__bool (*value)(const FLAC__SeekableStreamDecoder *decoder, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->eof_callback = value;
@ -317,9 +317,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_eof_callback(FLAC__SeekableStreamDe
FLAC__bool FLAC__seekable_stream_decoder_set_write_callback(FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->write_callback = value;
@ -328,9 +328,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_write_callback(FLAC__SeekableStream
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_callback(FLAC__SeekableStreamDecoder *decoder, void (*value)(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->metadata_callback = value;
@ -339,9 +339,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_callback(FLAC__SeekableStr
FLAC__bool FLAC__seekable_stream_decoder_set_error_callback(FLAC__SeekableStreamDecoder *decoder, void (*value)(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->error_callback = value;
@ -350,9 +350,9 @@ FLAC__bool FLAC__seekable_stream_decoder_set_error_callback(FLAC__SeekableStream
FLAC__bool FLAC__seekable_stream_decoder_set_client_data(FLAC__SeekableStreamDecoder *decoder, void *value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->client_data = value;
@ -361,10 +361,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_client_data(FLAC__SeekableStreamDec
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
if(type == FLAC__METADATA_TYPE_STREAMINFO)
@ -376,10 +376,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond(FLAC__SeekableStre
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
return FLAC__stream_decoder_set_metadata_respond_application(decoder->private_->stream_decoder, id);
@ -387,10 +387,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_application(FLAC__
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_all(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->ignore_stream_info_block = false;
@ -400,10 +400,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_respond_all(FLAC__Seekable
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__SeekableStreamDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
if(type == FLAC__METADATA_TYPE_STREAMINFO)
@ -415,10 +415,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__SeekableStrea
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
return FLAC__stream_decoder_set_metadata_ignore_application(decoder->private_->stream_decoder, id);
@ -426,10 +426,10 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__S
FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_->stream_decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->ignore_stream_info_block = true;
@ -439,58 +439,58 @@ FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__SeekableS
FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_state(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->state;
}
FLAC__bool FLAC__seekable_stream_decoder_get_md5_checking(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->md5_checking;
}
unsigned FLAC__seekable_stream_decoder_get_channels(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__stream_decoder_get_channels(decoder->private_->stream_decoder);
}
FLAC__ChannelAssignment FLAC__seekable_stream_decoder_get_channel_assignment(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__stream_decoder_get_channel_assignment(decoder->private_->stream_decoder);
}
unsigned FLAC__seekable_stream_decoder_get_bits_per_sample(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__stream_decoder_get_bits_per_sample(decoder->private_->stream_decoder);
}
unsigned FLAC__seekable_stream_decoder_get_sample_rate(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__stream_decoder_get_sample_rate(decoder->private_->stream_decoder);
}
unsigned FLAC__seekable_stream_decoder_get_blocksize(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
return FLAC__stream_decoder_get_blocksize(decoder->private_->stream_decoder);
}
FLAC__bool FLAC__seekable_stream_decoder_flush(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
decoder->private_->do_md5_checking = false;
@ -506,9 +506,9 @@ FLAC__bool FLAC__seekable_stream_decoder_flush(FLAC__SeekableStreamDecoder *deco
FLAC__bool FLAC__seekable_stream_decoder_reset(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(!FLAC__seekable_stream_decoder_flush(decoder)) {
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR;
@ -540,7 +540,7 @@ FLAC__bool FLAC__seekable_stream_decoder_reset(FLAC__SeekableStreamDecoder *deco
FLAC__bool FLAC__seekable_stream_decoder_process_whole_stream(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->stream_decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM;
@ -560,7 +560,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_whole_stream(FLAC__SeekableStre
FLAC__bool FLAC__seekable_stream_decoder_process_metadata(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->stream_decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM;
@ -580,7 +580,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_metadata(FLAC__SeekableStreamDe
FLAC__bool FLAC__seekable_stream_decoder_process_one_frame(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->stream_decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM;
@ -600,7 +600,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_one_frame(FLAC__SeekableStreamD
FLAC__bool FLAC__seekable_stream_decoder_process_remaining_frames(FLAC__SeekableStreamDecoder *decoder)
{
FLAC__bool ret;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->private_->stream_decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM;
@ -621,7 +621,7 @@ FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecod
{
FLAC__uint64 length;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_OK || decoder->protected_->state == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM);
decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_SEEKING;
@ -661,7 +661,7 @@ FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecod
*
***********************************************************************/
void seekable_stream_decoder_set_defaults_(FLAC__SeekableStreamDecoder *decoder)
void set_defaults_(FLAC__SeekableStreamDecoder *decoder)
{
decoder->private_->read_callback = 0;
decoder->private_->seek_callback = 0;

View File

@ -42,22 +42,22 @@ static FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' };
*
***********************************************************************/
static void stream_decoder_set_defaults_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels);
static FLAC__bool stream_decoder_has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id);
static FLAC__bool stream_decoder_find_metadata_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_read_metadata_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_skip_id3v2_tag_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_frame_sync_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame);
static FLAC__bool stream_decoder_read_frame_header_(FLAC__StreamDecoder *decoder);
static FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool stream_decoder_read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool stream_decoder_read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order);
static FLAC__bool stream_decoder_read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order);
static FLAC__bool stream_decoder_read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool stream_decoder_read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, FLAC__EntropyCodingMethod_PartitionedRice *partitioned_rice, FLAC__int32 *residual);
static FLAC__bool stream_decoder_read_zero_padding_(FLAC__StreamDecoder *decoder);
static void set_defaults_(FLAC__StreamDecoder *decoder);
static FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels);
static FLAC__bool has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id);
static FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder);
static FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder);
static FLAC__bool skip_id3v2_tag_(FLAC__StreamDecoder *decoder);
static FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder);
static FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame);
static FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder);
static FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order);
static FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order);
static FLAC__bool read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps);
static FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, FLAC__EntropyCodingMethod_PartitionedRice *partitioned_rice, FLAC__int32 *residual);
static FLAC__bool read_zero_padding_(FLAC__StreamDecoder *decoder);
static FLAC__bool read_callback_(FLAC__byte buffer[], unsigned *bytes, void *client_data);
/***********************************************************************
@ -183,7 +183,7 @@ FLAC__StreamDecoder *FLAC__stream_decoder_new()
decoder->private_->output_channels = 0;
decoder->private_->has_seek_table = false;
stream_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__STREAM_DECODER_UNINITIALIZED;
@ -192,14 +192,14 @@ FLAC__StreamDecoder *FLAC__stream_decoder_new()
void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->private_->input != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->private_->input);
FLAC__stream_decoder_finish(decoder);
if(decoder->private_->metadata_filter_ids != 0)
if(0 != decoder->private_->metadata_filter_ids)
free(decoder->private_->metadata_filter_ids);
FLAC__bitbuffer_delete(decoder->private_->input);
@ -216,7 +216,7 @@ void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder)
FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return decoder->protected_->state = FLAC__STREAM_DECODER_ALREADY_INITIALIZED;
@ -264,11 +264,11 @@ FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder)
void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder)
{
unsigned i;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__STREAM_DECODER_UNINITIALIZED)
return;
if(decoder->private_->has_seek_table) {
FLAC__ASSERT(decoder->private_->seek_table.data.seek_table.points != 0);
FLAC__ASSERT(0 != decoder->private_->seek_table.data.seek_table.points);
free(decoder->private_->seek_table.data.seek_table.points);
decoder->private_->seek_table.data.seek_table.points = 0;
decoder->private_->has_seek_table = false;
@ -276,11 +276,11 @@ void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder)
FLAC__bitbuffer_free(decoder->private_->input);
for(i = 0; i < FLAC__MAX_CHANNELS; i++) {
/* WATCHOUT: FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the output arrays have a buffer of up to 3 zeroes in front (at negative indices) for alignment purposes; we use 4 to keep the data well-aligned. */
if(decoder->private_->output[i] != 0) {
if(0 != decoder->private_->output[i]) {
free(decoder->private_->output[i]-4);
decoder->private_->output[i] = 0;
}
if(decoder->private_->residual[i] != 0) {
if(0 != decoder->private_->residual[i]) {
free(decoder->private_->residual[i]);
decoder->private_->residual[i] = 0;
}
@ -288,16 +288,16 @@ void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder)
decoder->private_->output_capacity = 0;
decoder->private_->output_channels = 0;
stream_decoder_set_defaults_(decoder);
set_defaults_(decoder);
decoder->protected_->state = FLAC__STREAM_DECODER_UNINITIALIZED;
}
FLAC__bool FLAC__stream_decoder_set_read_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadStatus (*value)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->read_callback = value;
@ -306,9 +306,9 @@ FLAC__bool FLAC__stream_decoder_set_read_callback(FLAC__StreamDecoder *decoder,
FLAC__bool FLAC__stream_decoder_set_write_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->write_callback = value;
@ -317,9 +317,9 @@ FLAC__bool FLAC__stream_decoder_set_write_callback(FLAC__StreamDecoder *decoder,
FLAC__bool FLAC__stream_decoder_set_metadata_callback(FLAC__StreamDecoder *decoder, void (*value)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->metadata_callback = value;
@ -328,9 +328,9 @@ FLAC__bool FLAC__stream_decoder_set_metadata_callback(FLAC__StreamDecoder *decod
FLAC__bool FLAC__stream_decoder_set_error_callback(FLAC__StreamDecoder *decoder, void (*value)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data))
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->error_callback = value;
@ -339,9 +339,9 @@ FLAC__bool FLAC__stream_decoder_set_error_callback(FLAC__StreamDecoder *decoder,
FLAC__bool FLAC__stream_decoder_set_client_data(FLAC__StreamDecoder *decoder, void *value)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
decoder->private_->client_data = value;
@ -350,9 +350,9 @@ FLAC__bool FLAC__stream_decoder_set_client_data(FLAC__StreamDecoder *decoder, vo
FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(type <= FLAC__METADATA_TYPE_VORBIS_COMMENT);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
@ -364,10 +364,10 @@ FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decode
FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(id != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != id);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
@ -391,9 +391,9 @@ FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDec
FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder)
{
unsigned i;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
for(i = 0; i < sizeof(decoder->private_->metadata_filter) / sizeof(decoder->private_->metadata_filter[0]); i++)
@ -404,9 +404,9 @@ FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *de
FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(type <= FLAC__METADATA_TYPE_VORBIS_COMMENT);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
@ -418,10 +418,10 @@ FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder
FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4])
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(id != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != id);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
@ -444,9 +444,9 @@ FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDeco
FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
return false;
memset(decoder->private_->metadata_filter, 0, sizeof(decoder->private_->metadata_filter));
@ -456,51 +456,51 @@ FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *dec
FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->state;
}
unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->channels;
}
FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->channel_assignment;
}
unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->bits_per_sample;
}
unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->sample_rate;
}
unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->protected_);
return decoder->protected_->blocksize;
}
FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(!FLAC__bitbuffer_clear(decoder->private_->input)) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
@ -513,9 +513,9 @@ FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder)
FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(decoder->private_ != 0);
FLAC__ASSERT(decoder->protected_ != 0);
FLAC__ASSERT(0 != decoder);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
if(!FLAC__stream_decoder_flush(decoder)) {
decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
@ -531,7 +531,7 @@ FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder)
FLAC__bool FLAC__stream_decoder_process_whole_stream(FLAC__StreamDecoder *decoder)
{
FLAC__bool dummy;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
return true;
@ -546,19 +546,19 @@ FLAC__bool FLAC__stream_decoder_process_whole_stream(FLAC__StreamDecoder *decode
while(1) {
switch(decoder->protected_->state) {
case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA:
if(!stream_decoder_find_metadata_(decoder))
if(!find_metadata_(decoder))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_READ_METADATA:
if(!stream_decoder_read_metadata_(decoder))
if(!read_metadata_(decoder))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
if(!stream_decoder_frame_sync_(decoder))
if(!frame_sync_(decoder))
return true; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_READ_FRAME:
if(!stream_decoder_read_frame_(decoder, &dummy))
if(!read_frame_(decoder, &dummy))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_END_OF_STREAM:
@ -572,7 +572,7 @@ FLAC__bool FLAC__stream_decoder_process_whole_stream(FLAC__StreamDecoder *decode
FLAC__bool FLAC__stream_decoder_process_metadata(FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
return true;
@ -587,11 +587,11 @@ FLAC__bool FLAC__stream_decoder_process_metadata(FLAC__StreamDecoder *decoder)
while(1) {
switch(decoder->protected_->state) {
case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA:
if(!stream_decoder_find_metadata_(decoder))
if(!find_metadata_(decoder))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_READ_METADATA:
if(!stream_decoder_read_metadata_(decoder))
if(!read_metadata_(decoder))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
@ -608,7 +608,7 @@ FLAC__bool FLAC__stream_decoder_process_metadata(FLAC__StreamDecoder *decoder)
FLAC__bool FLAC__stream_decoder_process_one_frame(FLAC__StreamDecoder *decoder)
{
FLAC__bool got_a_frame;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
return true;
@ -618,11 +618,11 @@ FLAC__bool FLAC__stream_decoder_process_one_frame(FLAC__StreamDecoder *decoder)
while(1) {
switch(decoder->protected_->state) {
case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
if(!stream_decoder_frame_sync_(decoder))
if(!frame_sync_(decoder))
return true; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_READ_FRAME:
if(!stream_decoder_read_frame_(decoder, &got_a_frame))
if(!read_frame_(decoder, &got_a_frame))
return false; /* above function sets the status for us */
if(got_a_frame)
return true; /* above function sets the status for us */
@ -639,7 +639,7 @@ FLAC__bool FLAC__stream_decoder_process_one_frame(FLAC__StreamDecoder *decoder)
FLAC__bool FLAC__stream_decoder_process_remaining_frames(FLAC__StreamDecoder *decoder)
{
FLAC__bool dummy;
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
if(decoder->protected_->state == FLAC__STREAM_DECODER_END_OF_STREAM)
return true;
@ -649,11 +649,11 @@ FLAC__bool FLAC__stream_decoder_process_remaining_frames(FLAC__StreamDecoder *de
while(1) {
switch(decoder->protected_->state) {
case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
if(!stream_decoder_frame_sync_(decoder))
if(!frame_sync_(decoder))
return true; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_READ_FRAME:
if(!stream_decoder_read_frame_(decoder, &dummy))
if(!read_frame_(decoder, &dummy))
return false; /* above function sets the status for us */
break;
case FLAC__STREAM_DECODER_END_OF_STREAM:
@ -673,7 +673,7 @@ FLAC__bool FLAC__stream_decoder_process_remaining_frames(FLAC__StreamDecoder *de
unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder)
{
FLAC__ASSERT(decoder != 0);
FLAC__ASSERT(0 != decoder);
return FLAC__bitbuffer_get_input_bytes_unconsumed(decoder->private_->input);
}
@ -683,7 +683,7 @@ unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecod
*
***********************************************************************/
void stream_decoder_set_defaults_(FLAC__StreamDecoder *decoder)
void set_defaults_(FLAC__StreamDecoder *decoder)
{
decoder->private_->read_callback = 0;
decoder->private_->write_callback = 0;
@ -696,7 +696,7 @@ void stream_decoder_set_defaults_(FLAC__StreamDecoder *decoder)
decoder->private_->metadata_filter_ids_count = 0;
}
FLAC__bool stream_decoder_allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels)
FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels)
{
unsigned i;
FLAC__int32 *tmp;
@ -707,11 +707,11 @@ FLAC__bool stream_decoder_allocate_output_(FLAC__StreamDecoder *decoder, unsigne
/* @@@ should change to use realloc() */
for(i = 0; i < FLAC__MAX_CHANNELS; i++) {
if(decoder->private_->output[i] != 0) {
if(0 != decoder->private_->output[i]) {
free(decoder->private_->output[i]);
decoder->private_->output[i] = 0;
}
if(decoder->private_->residual[i] != 0) {
if(0 != decoder->private_->residual[i]) {
free(decoder->private_->residual[i]);
decoder->private_->residual[i] = 0;
}
@ -741,7 +741,7 @@ FLAC__bool stream_decoder_allocate_output_(FLAC__StreamDecoder *decoder, unsigne
return true;
}
FLAC__bool stream_decoder_has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id)
FLAC__bool has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id)
{
unsigned i;
@ -755,7 +755,7 @@ FLAC__bool stream_decoder_has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__b
return false;
}
FLAC__bool stream_decoder_find_metadata_(FLAC__StreamDecoder *decoder)
FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder)
{
FLAC__uint32 x;
unsigned i, id;
@ -782,7 +782,7 @@ FLAC__bool stream_decoder_find_metadata_(FLAC__StreamDecoder *decoder)
id++;
i = 0;
if(id == 3) {
if(!stream_decoder_skip_id3v2_tag_(decoder))
if(!skip_id3v2_tag_(decoder))
return false; /* the read_callback_ sets the state for us */
}
continue;
@ -815,7 +815,7 @@ FLAC__bool stream_decoder_find_metadata_(FLAC__StreamDecoder *decoder)
return true;
}
FLAC__bool stream_decoder_read_metadata_(FLAC__StreamDecoder *decoder)
FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder)
{
FLAC__uint32 i, x, last_block, type, length;
FLAC__uint64 xx;
@ -938,7 +938,7 @@ FLAC__bool stream_decoder_read_metadata_(FLAC__StreamDecoder *decoder)
real_length -= FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8;
if(decoder->private_->metadata_filter_ids_count > 0 && stream_decoder_has_id_filtered_(decoder, block.data.application.id))
if(decoder->private_->metadata_filter_ids_count > 0 && has_id_filtered_(decoder, block.data.application.id))
skip_it = !skip_it;
}
@ -1052,7 +1052,7 @@ FLAC__bool stream_decoder_read_metadata_(FLAC__StreamDecoder *decoder)
return true;
}
FLAC__bool stream_decoder_skip_id3v2_tag_(FLAC__StreamDecoder *decoder)
FLAC__bool skip_id3v2_tag_(FLAC__StreamDecoder *decoder)
{
FLAC__uint32 x;
unsigned i, skip;
@ -1074,7 +1074,7 @@ FLAC__bool stream_decoder_skip_id3v2_tag_(FLAC__StreamDecoder *decoder)
return true;
}
FLAC__bool stream_decoder_frame_sync_(FLAC__StreamDecoder *decoder)
FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder)
{
FLAC__uint32 x;
FLAC__bool first = true;
@ -1129,7 +1129,7 @@ FLAC__bool stream_decoder_frame_sync_(FLAC__StreamDecoder *decoder)
return true;
}
FLAC__bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame)
FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame)
{
unsigned channel;
unsigned i;
@ -1145,11 +1145,11 @@ FLAC__bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *
FLAC__CRC16_UPDATE(decoder->private_->header_warmup[1], frame_crc);
FLAC__bitbuffer_reset_read_crc16(decoder->private_->input, frame_crc);
if(!stream_decoder_read_frame_header_(decoder))
if(!read_frame_header_(decoder))
return false;
if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC)
return true;
if(!stream_decoder_allocate_output_(decoder, decoder->private_->frame.header.blocksize, decoder->private_->frame.header.channels))
if(!allocate_output_(decoder, decoder->private_->frame.header.blocksize, decoder->private_->frame.header.channels))
return false;
for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) {
/*
@ -1181,14 +1181,14 @@ FLAC__bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *
/*
* now read it
*/
if(!stream_decoder_read_subframe_(decoder, channel, bps))
if(!read_subframe_(decoder, channel, bps))
return false;
if(decoder->protected_->state != FLAC__STREAM_DECODER_READ_FRAME) {
decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;
return true;
}
}
if(!stream_decoder_read_zero_padding_(decoder))
if(!read_zero_padding_(decoder))
return false;
/*
@ -1260,7 +1260,7 @@ FLAC__bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *
return true;
}
FLAC__bool stream_decoder_read_frame_header_(FLAC__StreamDecoder *decoder)
FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder)
{
FLAC__uint32 x;
FLAC__uint64 xx;
@ -1537,7 +1537,7 @@ FLAC__bool stream_decoder_read_frame_header_(FLAC__StreamDecoder *decoder)
return true;
}
FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
{
FLAC__uint32 x;
FLAC__bool wasted_bits;
@ -1567,11 +1567,11 @@ FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned
return true;
}
else if(x == 0) {
if(!stream_decoder_read_subframe_constant_(decoder, channel, bps))
if(!read_subframe_constant_(decoder, channel, bps))
return false;
}
else if(x == 2) {
if(!stream_decoder_read_subframe_verbatim_(decoder, channel, bps))
if(!read_subframe_verbatim_(decoder, channel, bps))
return false;
}
else if(x < 16) {
@ -1579,7 +1579,7 @@ FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned
return false;
}
else if(x <= 24) {
if(!stream_decoder_read_subframe_fixed_(decoder, channel, bps, (x>>1)&7))
if(!read_subframe_fixed_(decoder, channel, bps, (x>>1)&7))
return false;
}
else if(x < 64) {
@ -1587,7 +1587,7 @@ FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned
return false;
}
else {
if(!stream_decoder_read_subframe_lpc_(decoder, channel, bps, ((x>>1)&31)+1))
if(!read_subframe_lpc_(decoder, channel, bps, ((x>>1)&31)+1))
return false;
}
@ -1601,7 +1601,7 @@ FLAC__bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned
return true;
}
FLAC__bool stream_decoder_read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
{
FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant;
FLAC__int32 x;
@ -1622,7 +1622,7 @@ FLAC__bool stream_decoder_read_subframe_constant_(FLAC__StreamDecoder *decoder,
return true;
}
FLAC__bool stream_decoder_read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order)
FLAC__bool read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order)
{
FLAC__Subframe_Fixed *subframe = &decoder->private_->frame.subframes[channel].data.fixed;
FLAC__int32 i32;
@ -1659,7 +1659,7 @@ FLAC__bool stream_decoder_read_subframe_fixed_(FLAC__StreamDecoder *decoder, uns
/* read residual */
switch(subframe->entropy_coding_method.type) {
case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE:
if(!stream_decoder_read_residual_partitioned_rice_(decoder, order, &subframe->entropy_coding_method.data.partitioned_rice, decoder->private_->residual[channel]))
if(!read_residual_partitioned_rice_(decoder, order, &subframe->entropy_coding_method.data.partitioned_rice, decoder->private_->residual[channel]))
return false;
break;
default:
@ -1673,7 +1673,7 @@ FLAC__bool stream_decoder_read_subframe_fixed_(FLAC__StreamDecoder *decoder, uns
return true;
}
FLAC__bool stream_decoder_read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order)
FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order)
{
FLAC__Subframe_LPC *subframe = &decoder->private_->frame.subframes[channel].data.lpc;
FLAC__int32 i32;
@ -1732,7 +1732,7 @@ FLAC__bool stream_decoder_read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsig
/* read residual */
switch(subframe->entropy_coding_method.type) {
case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE:
if(!stream_decoder_read_residual_partitioned_rice_(decoder, order, &subframe->entropy_coding_method.data.partitioned_rice, decoder->private_->residual[channel]))
if(!read_residual_partitioned_rice_(decoder, order, &subframe->entropy_coding_method.data.partitioned_rice, decoder->private_->residual[channel]))
return false;
break;
default:
@ -1749,7 +1749,7 @@ FLAC__bool stream_decoder_read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsig
return true;
}
FLAC__bool stream_decoder_read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
FLAC__bool read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps)
{
FLAC__Subframe_Verbatim *subframe = &decoder->private_->frame.subframes[channel].data.verbatim;
FLAC__int32 x, *residual = decoder->private_->residual[channel];
@ -1771,7 +1771,7 @@ FLAC__bool stream_decoder_read_subframe_verbatim_(FLAC__StreamDecoder *decoder,
return true;
}
FLAC__bool stream_decoder_read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, FLAC__EntropyCodingMethod_PartitionedRice *partitioned_rice, FLAC__int32 *residual)
FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, FLAC__EntropyCodingMethod_PartitionedRice *partitioned_rice, FLAC__int32 *residual)
{
FLAC__uint32 rice_parameter;
int i;
@ -1814,7 +1814,7 @@ FLAC__bool stream_decoder_read_residual_partitioned_rice_(FLAC__StreamDecoder *d
return true;
}
FLAC__bool stream_decoder_read_zero_padding_(FLAC__StreamDecoder *decoder)
FLAC__bool read_zero_padding_(FLAC__StreamDecoder *decoder)
{
if(!FLAC__bitbuffer_is_consumed_byte_aligned(decoder->private_->input)) {
FLAC__uint32 zero = 0;