Home | History | Annotate | Download | only in libFLAC

Lines Matching refs:private_

297 	decoder->private_ = (FLAC__StreamDecoderPrivate*)calloc(1, sizeof(FLAC__StreamDecoderPrivate));
298 if(decoder->private_ == 0) {
304 decoder->private_->input = FLAC__bitreader_new();
305 if(decoder->private_->input == 0) {
306 free(decoder->private_);
312 decoder->private_->metadata_filter_ids_capacity = 16;
313 if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)malloc((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) * decoder->private_->metadata_filter_ids_capacity))) {
314 FLAC__bitreader_delete(decoder->private_->input);
315 free(decoder->private_);
322 decoder->private_->output[i] = 0;
323 decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0;
326 decoder->private_->output_capacity = 0;
327 decoder->private_->output_channels = 0;
328 decoder->private_->has_seek_table = false;
331 FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&decoder->private_->partitioned_rice_contents[i]);
333 decoder->private_->file = 0;
348 FLAC__ASSERT(0 != decoder->private_);
349 FLAC__ASSERT(0 != decoder->private_->input);
353 if(0 != decoder->private_->metadata_filter_ids)
354 free(decoder->private_->metadata_filter_ids);
356 FLAC__bitreader_delete(decoder->private_->input);
359 FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&decoder->private_->partitioned_rice_contents[i]);
361 free(decoder->private_);
405 decoder->private_->is_ogg = is_ogg;
413 FLAC__cpu_info(&decoder->private_->cpuinfo);
415 decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal;
416 decoder->private_->local_lpc_restore_signal_64bit = FLAC__lpc_restore_signal_wide;
417 decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal;
418 decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal;
419 decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block;
422 if(decoder->private_->cpuinfo.use_asm) {
424 FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
427 if(decoder->private_->cpuinfo.data.ia32.bswap)
428 decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap;
430 if(decoder->private_->cpuinfo.data.ia32.mmx) {
431 decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
432 decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32_mmx;
433 decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ia32_mmx;
436 decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
437 decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32;
438 decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ia32;
442 FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_PPC);
443 if(decoder->private_->cpuinfo.data.ppc.altivec) {
444 decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ppc_altivec_16;
445 decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8;
453 if(!FLAC__bitreader_init(decoder->private_->input, decoder->private_->cpuinfo, read_callback_, decoder)) {
458 decoder->private_->read_callback = read_callback;
459 decoder->private_->seek_callback = seek_callback;
460 decoder->private_->tell_callback = tell_callback;
461 decoder->private_->length_callback = length_callback;
462 decoder->private_->eof_callback = eof_callback;
463 decoder->private_->write_callback = write_callback;
464 decoder->private_->metadata_callback = metadata_callback;
465 decoder->private_->error_callback = error_callback;
466 decoder->private_->client_data = client_data;
467 decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0;
468 decoder->private_->samples_decoded = 0;
469 decoder->private_->has_stream_info = false;
470 decoder->private_->cached = false;
472 decoder->private_->do_md5_checking = decoder->protected_->md5_checking;
473 decoder->private_->is_seeking = false;
475 decoder->private_->internal_reset_hack = true; /* so the following reset does not try to rewind the input */
567 decoder->private_->file = file;
572 decoder->private_->file == stdin? 0: file_seek_callback_,
573 decoder->private_->file == stdin? 0: file_tell_callback_,
574 decoder->private_->file == stdin? 0: file_length_callback_,
671 FLAC__ASSERT(0 != decoder->private_);
681 FLAC__MD5Final(decoder->private_->computed_md5sum, &decoder->private_->md5context);
684 if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) {
685 free(decoder->private_->seek_table.data.seek_table.points);
686 decoder->private_->seek_table.data.seek_table.points = 0;
687 decoder->private_->has_seek_table = false;
689 FLAC__bitreader_free(decoder->private_->input);
697 if(0 != decoder->private_->output[i]) {
698 free(decoder->private_->output[i]-4);
699 decoder->private_->output[i] = 0;
701 if(0 != decoder->private_->residual_unaligned[i]) {
702 free(decoder->private_->residual_unaligned[i]);
703 decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0;
706 decoder->private_->output_capacity = 0;
707 decoder->private_->output_channels = 0;
710 if(decoder->private_->is_ogg)
714 if(0 != decoder->private_->file) {
715 if(decoder->private_->file != stdin)
716 fclose(decoder->private_->file);
717 decoder->private_->file = 0;
720 if(decoder->private_->do_md5_checking) {
721 if(memcmp(decoder->private_->stream_info.data.stream_info.md5sum, decoder->private_->computed_md5sum, 16))
724 decoder->private_->is_seeking = false;
736 FLAC__ASSERT(0 != decoder->private_);
741 /* can't check decoder->private_->is_ogg since that's not set until init time */
763 FLAC__ASSERT(0 != decoder->private_);
771 decoder->private_->metadata_filter[type] = true;
773 decoder->private_->metadata_filter_ids_count = 0;
780 FLAC__ASSERT(0 != decoder->private_);
786 if(decoder->private_->metadata_filter[FLAC__METADATA_TYPE_APPLICATION])
789 FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids);
791 if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) {
792 if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2))) {
796 decoder->private_->metadata_filter_ids_capacity *= 2;
799 memcpy(decoder->private_->metadata_filter_ids + decoder->private_->metadata_filter_ids_count * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8));
800 decoder->private_->metadata_filter_ids_count++;
809 FLAC__ASSERT(0 != decoder->private_);
813 for(i = 0; i < sizeof(decoder->private_->metadata_filter) / sizeof(decoder->private_->metadata_filter[0]); i++)
814 decoder->private_->metadata_filter[i] = true;
815 decoder->private_->metadata_filter_ids_count = 0;
822 FLAC__ASSERT(0 != decoder->private_);
830 decoder->private_->metadata_filter[type] = false;
832 decoder->private_->metadata_filter_ids_count = 0;
839 FLAC__ASSERT(0 != decoder->private_);
845 if(!decoder->private_->metadata_filter[FLAC__METADATA_TYPE_APPLICATION])
848 FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids);
850 if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) {
851 if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2))) {
855 decoder->private_->metadata_filter_ids_capacity *= 2;
858 memcpy(decoder->private_->metadata_filter_ids + decoder->private_->metadata_filter_ids_count * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8));
859 decoder->private_->metadata_filter_ids_count++;
867 FLAC__ASSERT(0 != decoder->private_);
871 memset(decoder->private_->metadata_filter, 0, sizeof(decoder->private_->metadata_filter));
872 decoder->private_->metadata_filter_ids_count = 0;
899 return decoder->private_->has_stream_info? decoder->private_->stream_info.data.stream_info.total_samples : 0;
940 FLAC__ASSERT(0 != decoder->private_);
944 if(decoder->private_->is_ogg)
947 if(0 == decoder->private_->tell_callback)
949 if(decoder->private_->tell_callback(decoder, position, decoder->private_->client_data) != FLAC__STREAM_DECODER_TELL_STATUS_OK)
952 if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input))
962 FLAC__ASSERT(0 != decoder->private_);
965 decoder->private_->samples_decoded = 0;
966 decoder->private_->do_md5_checking = false;
969 if(decoder->private_->is_ogg)
973 if(!FLAC__bitreader_clear(decoder->private_->input)) {
985 FLAC__ASSERT(0 != decoder->private_);
995 if(decoder->private_->is_ogg)
1004 if(!decoder->private_->internal_reset_hack) {
1005 if(decoder->private_->file == stdin)
1007 if(decoder->private_->seek_callback && decoder->private_->seek_callback(decoder, 0, decoder->private_->client_data) == FLAC__STREAM_DECODER_SEEK_STATUS_ERROR)
1011 decoder->private_->internal_reset_hack = false;
1015 decoder->private_->has_stream_info = false;
1016 if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) {
1017 free(decoder->private_->seek_table.data.seek_table.points);
1018 decoder->private_->seek_table.data.seek_table.points = 0;
1019 decoder->private_->has_seek_table = false;
1021 decoder->private_->do_md5_checking = decoder->protected_->md5_checking;
1026 decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0;
1035 FLAC__MD5Init(&decoder->private_->md5context);
1038 decoder->private_->first_frame_offset = 0;
1039 decoder->private_->unparseable_frame_count = 0;
1188 if(0 == decoder->private_->seek_callback)
1191 FLAC__ASSERT(decoder->private_->seek_callback);
1192 FLAC__ASSERT(decoder->private_->tell_callback);
1193 FLAC__ASSERT(decoder->private_->length_callback);
1194 FLAC__ASSERT(decoder->private_->eof_callback);
1199 decoder->private_->is_seeking = true;
1202 decoder->private_->do_md5_checking = false;
1205 if(decoder->private_->length_callback(decoder, &length, decoder->private_->client_data) != FLAC__STREAM_DECODER_LENGTH_STATUS_OK) {
1206 decoder->private_->is_seeking = false;
1217 decoder->private_->is_seeking = false;
1222 decoder->private_->is_seeking = false;
1230 decoder->private_->is_ogg?
1235 decoder->private_->is_seeking = false;
1249 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1250 FLAC__ASSERT(!(FLAC__bitreader_get_input_bits_unconsumed(decoder->private_->input) & 7));
1251 return FLAC__bitreader_get_input_bits_unconsumed(decoder->private_->input) / 8;
1263 decoder->private_->is_ogg = false;
1265 decoder->private_->read_callback = 0;
1266 decoder->private_->seek_callback = 0;
1267 decoder->private_->tell_callback = 0;
1268 decoder->private_->length_callback = 0;
1269 decoder->private_->eof_callback = 0;
1270 decoder->private_->write_callback = 0;
1271 decoder->private_->metadata_callback = 0;
1272 decoder->private_->error_callback = 0;
1273 decoder->private_->client_data = 0;
1275 memset(decoder->private_->metadata_filter, 0, sizeof(decoder->private_->metadata_filter));
1276 decoder->private_->metadata_filter[FLAC__METADATA_TYPE_STREAMINFO] = true;
1277 decoder->private_->metadata_filter_ids_count = 0;
1312 if(size <= decoder->private_->output_capacity && channels <= decoder->private_->output_channels)
1318 if(0 != decoder->private_->output[i]) {
1319 free(decoder->private_->output[i]-4);
1320 decoder->private_->output[i] = 0;
1322 if(0 != decoder->private_->residual_unaligned[i]) {
1323 free(decoder->private_->residual_unaligned[i]);
1324 decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0;
1341 decoder->private_->output[i] = tmp + 4;
1346 if(!FLAC__memory_alloc_aligned_int32_array(size, &decoder->private_->residual_unaligned[i], &decoder->private_->residual[i])) {
1352 decoder->private_->output_capacity = size;
1353 decoder->private_->output_channels = channels;
1363 FLAC__ASSERT(0 != decoder->private_);
1365 for(i = 0; i < decoder->private_->metadata_filter_ids_count; i++)
1366 if(0 == memcmp(decoder->private_->metadata_filter_ids + i * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)))
1378 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1381 if(decoder->private_->cached) {
1382 x = (FLAC__uint32)decoder->private_->lookahead;
1383 decoder->private_->cached = false;
1386 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
1406 decoder->private_->header_warmup[0] = (FLAC__byte)x;
1407 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
1413 decoder->private_->lookahead = (FLAC__byte)x;
1414 decoder->private_->cached = true;
1417 decoder->private_->header_warmup[1] = (FLAC__byte)x;
1438 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1440 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_IS_LAST_LEN))
1444 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &type, FLAC__STREAM_METADATA_TYPE_LEN))
1447 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &length, FLAC__STREAM_METADATA_LENGTH_LEN))
1454 decoder->private_->has_stream_info = true;
1455 if(0 == memcmp(decoder->private_->stream_info.data.stream_info.md5sum, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
1456 decoder->private_->do_md5_checking = false;
1457 if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_STREAMINFO] && decoder->private_->metadata_callback)
1458 decoder->private_->metadata_callback(decoder, &decoder->private_->stream_info, decoder->private_->client_data);
1464 decoder->private_->has_seek_table = true;
1465 if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_SEEKTABLE] && decoder->private_->metadata_callback)
1466 decoder->private_->metadata_callback(decoder, &decoder->private_->seek_table, decoder->private_->client_data);
1469 FLAC__bool skip_it = !decoder->private_->metadata_filter[type];
1478 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8))
1488 if(decoder->private_->metadata_filter_ids_count > 0 && has_id_filtered_(decoder, block.data.application.id))
1493 if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, real_length))
1500 if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, real_length))
1510 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.application.data, real_length))
1538 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.unknown.data, real_length))
1545 if(!decoder->private_->is_seeking && decoder->private_->metadata_callback)
1546 decoder->private_->metadata_callback(decoder, &block, decoder->private_->client_data);
1595 if(!FLAC__stream_decoder_get_decode_position(decoder, &decoder->private_->first_frame_offset))
1596 decoder->private_->first_frame_offset = 0;
1608 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1610 decoder->private_->stream_info.type = FLAC__METADATA_TYPE_STREAMINFO;
1611 decoder->private_->stream_info.is_last = is_last;
1612 decoder->private_->stream_info.length = length;
1615 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, bits))
1617 decoder->private_->stream_info.data.stream_info.min_blocksize = x;
1621 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN))
1623 decoder->private_->stream_info.data.stream_info.max_blocksize = x;
1627 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN))
1629 decoder->private_->stream_info.data.stream_info.min_framesize = x;
1633 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN))
1635 decoder->private_->stream_info.data.stream_info.max_framesize = x;
1639 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN))
1641 decoder->private_->stream_info.data.stream_info.sample_rate = x;
1645 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN))
1647 decoder->private_->stream_info.data.stream_info.channels = x+1;
1651 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN))
1653 decoder->private_->stream_info.data.stream_info.bits_per_sample = x+1;
1657 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &decoder->private_->stream_info.data.stream_info.total_samples, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN))
1661 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, decoder->private_->stream_info.data.stream_info.md5sum, 16))
1668 if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, length))
1679 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1681 decoder->private_->seek_table.type = FLAC__METADATA_TYPE_SEEKTABLE;
1682 decoder->private_->seek_table.is_last = is_last;
1683 decoder->private_->seek_table.length = length;
1685 decoder->private_->seek_table.data.seek_table.num_points = length / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
1688 if(0 == (decoder->private_->seek_table.data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)safe_realloc_mul_2op_(decoder->private_->seek_table.data.seek_table.points, decoder->private_->seek_table.data.seek_table.num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)))) {
1692 for(i = 0; i < decoder->private_->seek_table.data.seek_table.num_points; i++) {
1693 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &xx, FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN))
1695 decoder->private_->seek_table.data.seek_table.points[i].sample_number = xx;
1697 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &xx, FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN))
1699 decoder->private_->seek_table.data.seek_table.points[i].stream_offset = xx;
1701 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN))
1703 decoder->private_->seek_table.data.seek_table.points[i].frame_samples = x;
1705 length -= (decoder->private_->seek_table.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH);
1709 if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, length))
1720 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1724 if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->vendor_string.length))
1731 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->vendor_string.entry, obj->vendor_string.length))
1740 if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->num_comments))
1751 if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->comments[i].length))
1758 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length))
1777 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1782 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)obj->media_catalog_number, FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN/8))
1785 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &obj->lead_in, FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN))
1788 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN))
1792 if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN))
1795 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN))
1806 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &track->offset, FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN))
1809 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN))
1814 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8))
1817 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN))
1821 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN))
1825 if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN))
1828 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN))
1839 if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &index->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN))
1842 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN))
1846 if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN))
1860 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
1863 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_TYPE_LEN))
1868 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN))
1875 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)obj->mime_type, x))
1881 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN))
1888 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->description, x))
1894 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->width, FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN))
1898 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->height, FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN))
1902 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->depth, FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN))
1906 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->colors, FLAC__STREAM_METADATA_PICTURE_COLORS_LEN))
1910 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &(obj->data_length), FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN))
1917 if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->data, obj->data_length))
1930 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 24))
1935 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
1941 if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, skip))
1954 if(decoder->private_->samples_decoded >= FLAC__stream_decoder_get_total_samples(decoder)) {
1961 if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)) {
1962 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__bitreader_bits_left_for_byte_alignment(decoder->private_->input)))
1967 if(decoder->private_->cached) {
1968 x = (FLAC__uint32)decoder->private_->lookahead;
1969 decoder->private_->cached = false;
1972 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
1976 decoder->private_->header_warmup[0] = (FLAC__byte)x;
1977 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
1983 decoder->private_->lookahead = (FLAC__byte)x;
1984 decoder->private_->cached = true;
1987 decoder->private_->header_warmup[1] = (FLAC__byte)x;
2013 frame_crc = FLAC__CRC16_UPDATE(decoder->private_->header_warmup[0], frame_crc);
2014 frame_crc = FLAC__CRC16_UPDATE(decoder->private_->header_warmup[1], frame_crc);
2015 FLAC__bitreader_reset_read_crc16(decoder->private_->input, (FLAC__uint16)frame_crc);
2021 if(!allocate_output_(decoder, decoder->private_->frame.header.blocksize, decoder->private_->frame.header.channels))
2023 for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) {
2027 unsigned bps = decoder->private_->frame.header.bits_per_sample;
2028 switch(decoder->private_->frame.header.channel_assignment) {
2033 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2038 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2043 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2066 frame_crc = FLAC__bitreader_get_read_crc16(decoder->private_->input);
2067 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__FRAME_FOOTER_CRC_LEN))
2072 switch(decoder->private_->frame.header.channel_assignment) {
2077 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2078 for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
2079 decoder->private_->output[1][i] = decoder->private_->output[0][i] - decoder->private_->output[1][i];
2082 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2083 for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
2084 decoder->private_->output[0][i] += decoder->private_->output[1][i];
2087 FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
2088 for(i = 0; i < decoder->private_->frame.header.blocksize; i++) {
2090 mid = decoder->private_->output[0][i];
2091 side = decoder->private_->output[1][i];
2094 decoder->private_->output[0][i] = (mid + side) >> 1;
2095 decoder->private_->output[1][i] = (mid - side) >> 1;
2098 mid = (decoder->private_->output[0][i] << 1) | (decoder->private_->output[1][i] & 1); /* i.e. if 'side' is odd... */
2099 decoder->private_->output[0][i] = (mid + decoder->private_->output[1][i]) >> 1;
2100 decoder->private_->output[1][i] = (mid - decoder->private_->output[1][i]) >> 1;
2114 for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) {
2115 memset(decoder->private_->output[channel], 0, sizeof(FLAC__int32) * decoder->private_->frame.header.blocksize);
2123 if(decoder->private_->next_fixed_block_size)
2124 decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size;
2127 decoder->protected_->channels = decoder->private_->frame.header.channels;
2128 decoder->protected_->channel_assignment = decoder->private_->frame.header.channel_assignment;
2129 decoder->protected_->bits_per_sample = decoder->private_->frame.header.bits_per_sample;
2130 decoder->protected_->sample_rate = decoder->private_->frame.header.sample_rate;
2131 decoder->protected_->blocksize = decoder->private_->frame.header.blocksize;
2133 FLAC__ASSERT(decoder->private_->frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER);
2134 decoder->private_->samples_decoded = decoder->private_->frame.header.number.sample_number + decoder->private_->frame.header.blocksize;
2138 if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE)
2155 FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
2158 raw_header[0] = decoder->private_->header_warmup[0];
2159 raw_header[1] = decoder->private_->header_warmup[1];
2189 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
2193 decoder->private_->lookahead = (FLAC__byte)x;
2194 decoder->private_->cached = true;
2207 decoder->private_->frame.header.blocksize = 192;
2213 decoder->private_->frame.header.blocksize = 576 << (x-2);
2227 decoder->private_->frame.header.blocksize = 256 << (x-8);
2236 if(decoder->private_->has_stream_info)
2237 decoder->private_->frame.header.sample_rate = decoder->private_->stream_info.data.stream_info.sample_rate;
2242 decoder->private_->frame.header.sample_rate = 88200;
2245 decoder->private_->frame.header.sample_rate = 176400;
2248 decoder->private_->frame.header.sample_rate = 192000;
2251 decoder->private_->frame.header.sample_rate = 8000;
2254 decoder->private_->frame.header.sample_rate = 16000;
2257 decoder->private_->frame.header.sample_rate = 22050;
2260 decoder->private_->frame.header.sample_rate = 24000;
2263 decoder->private_->frame.header.sample_rate = 32000;
2266 decoder->private_->frame.header.sample_rate = 44100;
2269 decoder->private_->frame.header.sample_rate = 48000;
2272 decoder->private_->frame.header.sample_rate = 96000;
2289 decoder->private_->frame.header.channels = 2;
2292 decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE;
2295 decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE;
2298 decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_MID_SIDE;
2306 decoder->private_->frame.header.channels = (unsigned)x + 1;
2307 decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT;
2312 if(decoder->private_->has_stream_info)
2313 decoder->private_->frame.header.bits_per_sample = decoder->private_->stream_info.data.stream_info.bits_per_sample;
2318 decoder->private_->frame.header.bits_per_sample = 8;
2321 decoder->private_->frame.header.bits_per_sample = 12;
2324 decoder->private_->frame.header.bits_per_sample = 16;
2327 decoder->private_->frame.header.bits_per_sample = 20;
2330 decoder->private_->frame.header.bits_per_sample = 24;
2349 (decoder->private_->has_stream_info && decoder->private_->stream_info.data.stream_info.min_blocksize != decoder->private_->stream_info.data.stream_info.max_blocksize)
2351 if(!FLAC__bitreader_read_utf8_uint64(decoder->private_->input, &xx, raw_header, &raw_header_len))
2354 decoder->private_->lookahead = raw_header[raw_header_len-1]; /* back up as much as we can */
2355 decoder->private_->cached = true;
2360 decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER;
2361 decoder->private_->frame.header.number.sample_number = xx;
2364 if(!FLAC__bitreader_read_utf8_uint32(decoder->private_->input, &x, raw_header, &raw_header_len))
2367 decoder->private_->lookahead = raw_header[raw_header_len-1]; /* back up as much as we can */
2368 decoder->private_->cached = true;
2373 decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER;
2374 decoder->private_->frame.header.number.frame_number = x;
2378 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
2383 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &_x, 8))
2388 decoder->private_->frame.header.blocksize = x+1;
2392 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
2397 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &_x, 8))
2403 decoder->private_->frame.header.sample_rate = x*1000;
2405 decoder->private_->frame.header.sample_rate = x;
2407 decoder->private_->frame.header.sample_rate = x*10;
2411 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8))
2422 decoder->private_->next_fixed_block_size = 0;
2423 if(decoder->private_->frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER) {
2424 x = decoder->private_->frame.header.number.frame_number;
2425 decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER;
2426 if(decoder->private_->fixed_block_size)
2427 decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->fixed_block_size * (FLAC__uint64)x;
2428 else if(decoder->private_->has_stream_info) {
2429 if(decoder->private_->stream_info.data.stream_info.min_blocksize == decoder->private_->stream_info.data.stream_info.max_blocksize) {
2430 decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->stream_info.data.stream_info.min_blocksize * (FLAC__uint64)x;
2431 decoder->private_->next_fixed_block_size = decoder->private_->stream_info.data.stream_info.max_blocksize;
2437 decoder->private_->frame.header.number.sample_number = 0;
2438 decoder->private_->next_fixed_block_size = decoder->private_->frame.header.blocksize;
2442 decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->frame.header.blocksize * (FLAC__uint64)x;
2461 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) /* MAGIC NUMBER */
2469 if(!FLAC__bitreader_read_unary_unsigned(decoder->private_->input, &u))
2471 decoder->private_->frame.subframes[channel].wasted_bits = u+1;
2472 bps -= decoder->private_->frame.subframes[channel].wasted_bits;
2475 decoder->private_->frame.subframes[channel].wasted_bits = 0;
2517 x = decoder->private_->frame.subframes[channel].wasted_bits;
2518 for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
2519 decoder->private_->output[channel][i] <<= x;
2527 FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant;
2530 FLAC__int32 *output = decoder->private_->output[channel];
2532 decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_CONSTANT;
2534 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &x, bps))
2541 for(i = 0; i < decoder->private_->frame.header.blocksize; i++)
2550 FLAC__Subframe_Fixed *subframe = &decoder->private_->frame.subframes[channel].data.fixed;
2555 decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_FIXED;
2557 subframe->residual = decoder->private_->residual[channel];
2562 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, bps))
2568 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_TYPE_LEN))
2574 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN))
2577 subframe->entropy_coding_method.data.partitioned_rice.contents = &decoder->private_->partitioned_rice_contents[channel];
2589 if(!read_residual_partitioned_rice_(decoder, order, subframe->entropy_coding_method.data.partitioned_rice.order, &decoder->private_->partitioned_rice_contents[channel], decoder->private_->residual[channel], /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2))
2598 memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order);
2599 FLAC__fixed_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, order, decoder->private_->output[channel]+order);
2607 FLAC__Subframe_LPC *subframe = &decoder->private_->frame.subframes[channel].data.lpc;
2612 decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_LPC;
2614 subframe->residual = decoder->private_->residual[channel];
2619 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, bps))
2625 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN))
2635 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN))
2641 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, subframe->qlp_coeff_precision))
2647 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_TYPE_LEN))
2653 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN))
2656 subframe->entropy_coding_method.data.partitioned_rice.contents = &decoder->private_->partitioned_rice_contents[channel];
2668 if(!read_residual_partitioned_rice_(decoder, order, subframe->entropy_coding_method.data.partitioned_rice.order, &decoder->private_->partitioned_rice_contents[channel], decoder->private_->residual[channel], /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2))
2677 memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order);
2684 decoder->private_->local_lpc_restore_signal_16bit_order8(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
2686 decoder->private_->local_lpc_restore_signal_16bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
2689 decoder->private_->local_lpc_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
2691 decoder->private_->local_lpc_restore_signal_64bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
2699 FLAC__Subframe_Verbatim *subframe = &decoder->private_->frame.subframes[channel].data.verbatim;
2700 FLAC__int32 x, *residual = decoder->private_->residual[channel];
2703 decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_VERBATIM;
2707 for(i = 0; i < decoder->private_->frame.header.blocksize; i++) {
2708 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &x, bps))
2715 memcpy(decoder->private_->output[channel], subframe->data, sizeof(FLAC__int32) * decoder->private_->frame.header.blocksize);
2726 const unsigned partition_samples = partition_order > 0? decoder->private_->frame.header.blocksize >> partition_order : decoder->private_->frame.header.blocksize - predictor_order;
2732 if(decoder->private_->frame.header.blocksize < predictor_order) {
2753 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &rice_parameter, plen))
2759 if(!decoder->private_->local_bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter))
2764 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &rice_parameter, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN))
2768 if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i, rice_parameter))
2780 if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)) {
2782 if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &zero, FLAC__bitreader_bits_left_for_byte_alignment(decoder->private_->input)))
2799 !decoder->private_->is_ogg &&
2801 decoder->private_->eof_callback && decoder->private_->eof_callback(decoder, decoder->private_->client_data)
2818 if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) {
2825 decoder->private_->is_ogg?
2828 decoder->private_->read_callback(decoder, buffer, bytes, decoder->private_->client_data)
2840 !decoder->private_->is_ogg &&
2842 decoder->private_->eof_callback && decoder->private_->eof_callback(decoder, decoder->private_->client_data)
2875 switch(FLAC__ogg_decoder_aspect_read_callback_wrapper(&decoder->protected_->ogg_decoder_aspect, buffer, bytes, read_callback_proxy_, decoder, decoder->private_->client_data)) {
2903 switch(decoder->private_->read_callback(decoder, buffer, bytes, client_data)) {
2920 if(decoder->private_->is_seeking) {
2923 FLAC__uint64 target_sample = decoder->private_->target_sample;
2928 decoder->private_->got_a_frame = true;
2930 decoder->private_->last_frame = *frame; /* save the frame */
2934 decoder->private_->is_seeking = false;
2941 decoder->private_->last_frame.header.blocksize -= delta;
2942 decoder->private_->last_frame.header.number.sample_number += (FLAC__uint64)delta;
2944 return decoder->private_->write_callback(decoder, &decoder->private_->last_frame, newbuffer, decoder->private_->client_data);
2948 return decoder->private_->write_callback(decoder, frame, buffer, decoder->private_->client_data);
2960 if(!decoder->private_->has_stream_info)
2961 decoder->private_->do_md5_checking = false;
2963 if(decoder->private_->do_md5_checking) {
2964 if(!FLAC__MD5Accumulate(&decoder->private_->md5context, buffer, frame->header.channels, frame->header.blocksize, (frame->header.bits_per_sample+7) / 8))
2968 return decoder->private_->write_callback(decoder, frame, buffer, decoder->private_->client_data);
2974 if(!decoder->private_->is_seeking)
2975 decoder->private_->error_callback(decoder, status, decoder->private_->client_data);
2977 decoder->private_->unparseable_frame_count++;
2982 FLAC__uint64 first_frame_offset = decoder->private_->first_frame_offset, lower_bound, upper_bound, lower_bound_sample, upper_bound_sample, this_frame_sample;
2988 const unsigned min_blocksize = decoder->private_->stream_info.data.stream_info.min_blocksize;
2989 const unsigned max_blocksize = decoder->private_->stream_info.data.stream_info.max_blocksize;
2990 const unsigned max_framesize = decoder->private_->stream_info.data.stream_info.max_framesize;
2991 const unsigned min_framesize = decoder->private_->stream_info.data.stream_info.min_framesize;
2995 const FLAC__StreamMetadata_SeekTable *seek_table = decoder->private_->has_seek_table? &decoder->private_->seek_table.data.seek_table : 0;
2999 channels = decoder->private_->stream_info.data.stream_info.channels;
3001 bps = decoder->private_->stream_info.data.stream_info.bits_per_sample;
3095 decoder->private_->target_sample = target_sample;
3120 if(decoder->private_->seek_callback(decoder, (FLAC__uint64)pos, decoder->private_->client_data) != FLAC__STREAM_DECODER_SEEK_STATUS_OK) {
3134 decoder->private_->unparseable_frame_count = 0;
3146 if(!decoder->private_->is_seeking)
3149 FLAC__ASSERT(decoder->private_->last_frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER);
3150 this_frame_sample = decoder->private_->last_frame.header.number.sample_number;
3152 if (0 == decoder->private_->samples_decoded || (this_frame_sample + decoder->private_->last_frame.header.blocksize >= upper_bound_sample && !first_seek)) {
3173 upper_bound_sample = this_frame_sample + decoder->private_->last_frame.header.blocksize;
3182 lower_bound_sample = this_frame_sample + decoder->private_->last_frame.header.blocksize;
3224 decoder->private_->target_sample = target_sample;
3253 if(decoder->private_->seek_callback((FLAC__StreamDecoder*)decoder, (FLAC__uint64)pos, decoder->private_->client_data) != FLAC__STREAM_DECODER_SEEK_STATUS_OK) {
3266 decoder->private_->got_a_frame = false;
3271 if(!decoder->private_->got_a_frame) {
3289 else if(!decoder->private_->is_seeking) {
3293 this_frame_sample = decoder->private_->last_frame.header.number.sample_number;
3294 FLAC__ASSERT(decoder->private_->last_frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER);
3336 *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, decoder->private_->file);
3337 if(ferror(decoder->private_->file))
3352 if(decoder->private_->file == stdin)
3354 else if(fseeko(decoder->private_->file, (off_t)absolute_byte_offset, SEEK_SET) < 0)
3365 if(decoder->private_->file == stdin)
3367 else if((pos = ftello(decoder->private_->file)) < 0)
3380 if(decoder->private_->file == stdin)
3382 else if(fstat(fileno(decoder->private_->file), &filestats) != 0)
3394 return feof(decoder->private_->file)? true : false;