Recognizes if input is ogg or not.
[xiph.git] / oggdsf / docs / old_flac_changes_i_made.txt
blob63f361aa18f289a57b9b57bb8484e156261cc471
1 Changes to old version of FLAC i made...\r
2 \r
3 stream_decoder.c (line 542)\r
4 \r
5 FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder)
7         FLAC__ASSERT(0 != decoder);
8         FLAC__ASSERT(0 != decoder->private_);
9         FLAC__ASSERT(0 != decoder->protected_);
11         if(!FLAC__bitbuffer_clear(decoder->private_->input)) {
12                 decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;
13                 return false;
14         }
15         decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;
16         //Insert by ZEN:::
17         decoder->private_->samples_decoded = 0;
19         return true;
20 }\r
23 bitbuffer.c (line 184)\r
25 static FLAC__bool bitbuffer_read_from_client_(FLAC__BitBuffer *bb, FLAC__bool (*read_callback)(FLAC__byte buffer[], unsigned *bytes, void *client_data), void *client_data)
27         unsigned bytes;
28         FLAC__byte *target;
30         /* first shift the unconsumed buffer data toward the front as much as possible */
31         if(bb->total_consumed_bits >= FLAC__BITS_PER_BLURB) {
32                 unsigned l = 0, r = bb->consumed_blurbs, r_end = bb->blurbs + (bb->bits? 1:0);
33                 for( ; r < r_end; l++, r++)
34                         bb->buffer[l] = bb->buffer[r];
35                 for( ; l < r_end; l++)
36                         bb->buffer[l] = 0;
37                 //Added by Zen:::
38                 FLAC__ASSERT(bb->blurbs >= bb->consumed_blurbs);
39                 bb->blurbs -= bb->consumed_blurbs;
40                 bb->total_bits -= FLAC__BLURBS_TO_BITS(bb->consumed_blurbs);
41                 bb->consumed_blurbs = 0;
42                 bb->total_consumed_bits = bb->consumed_bits;
43         }
45         /* grow if we need to */
46         if(bb->capacity <= 1) {
47                 if(!bitbuffer_resize_(bb, 16))
48                         return false;
49         }\r