search for: stream_length

Displaying 9 results from an estimated 9 matches for "stream_length".

2006 Oct 28
3
better seeking
...c/src/libFLAC/stream_decoder.c,v retrieving revision 1.117 diff -u -r1.117 stream_decoder.c --- stream_decoder.c 16 Oct 2006 15:49:18 -0000 1.117 +++ stream_decoder.c 28 Oct 2006 17:12:19 -0000 @@ -2923,18 +2923,18 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) { - FLAC__uint64 first_frame_offset = decoder->private_->first_frame_offset, lower_bound, upper_bound; + FLAC__uint64 first_frame_offset = decoder->private_->first_frame_offset, lower_bound, upper_bound, lower_bound_sample, upper_bound_sample; FLAC__int64...
2004 Sep 10
2
better seeking
...- next part -------------- --- src/libFLAC/seekable_stream_decoder.c.orig 2003-02-26 19:41:51.000000000 +0100 +++ src/libFLAC/seekable_stream_decoder.c 2003-07-09 23:49:35.000000000 +0200 @@ -816,11 +816,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) { - FLAC__uint64 first_frame_offset, lower_bound, upper_bound; - FLAC__int64 pos = -1, last_pos = -1; - int i, lower_seek_point = -1, upper_seek_point = -1; + FLAC__uint64 first_frame_offset, lower_bound, upper_bound, lower_bound_sample, upper_bound_sample; + FLAC__int...
2005 Jan 25
0
bitbuffer optimizations
...av Lichvar -------------- next part -------------- --- seekable_stream_decoder.c.orig 2005-01-25 05:18:31.000000000 +0100 +++ seekable_stream_decoder.c 2005-01-25 23:39:03.000000000 +0100 @@ -857,11 +857,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) { - FLAC__uint64 first_frame_offset, lower_bound, upper_bound; - FLAC__int64 pos = -1, last_pos = -1; - int i, lower_seek_point = -1, upper_seek_point = -1; + FLAC__uint64 first_frame_offset, lower_bound, upper_bound, lower_bound_sample, upper_bound_sample; + FLAC__int...
2006 Nov 03
2
better seeking
...coder.c,v retrieving revision 1.117 diff -u -r1.117 stream_decoder.c --- src/libFLAC/stream_decoder.c 16 Oct 2006 15:49:18 -0000 1.117 +++ src/libFLAC/stream_decoder.c 3 Nov 2006 08:32:35 -0000 @@ -2923,23 +2923,23 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) { - FLAC__uint64 first_frame_offset = decoder->private_->first_frame_offset, lower_bound, upper_bound; - FLAC__int64 pos = -1, last_pos = -1; - int i, lower_seek_point = -1, upper_seek_point = -1; + FLAC__uint64 first_frame_offset = decoder->private_->first...
2004 Sep 10
4
bitbuffer optimizations
Ok, here is a patch waiting for new CVS :). It works fine for me, but please check it before commiting... -- Miroslav Lichvar -------------- next part -------------- --- src/libFLAC/bitbuffer.c.orig 2003-01-30 17:36:01.000000000 +0100 +++ src/libFLAC/bitbuffer.c 2003-01-30 21:53:18.000000000 +0100 @@ -51,6 +51,25 @@ */ static const unsigned FLAC__BITBUFFER_DEFAULT_CAPACITY = ((65536 - 64) *
2004 Sep 10
0
better seeking
...decoder); + const unsigned channels = decoder->private_->stream_info.channels; + const unsigned bps = decoder->private_->stream_info.bits_per_sample; /* we are just guessing here, but we want to guess high, not low */ if(max_framesize > 0) { @@ -869,7 +869,7 @@ upper_bound = stream_length - (max_framesize + 128 + 2); /* 128 for a possible ID3V1 tag, 2 for indexing differences */ else upper_bound = stream_length - ((channels * bps * FLAC__MAX_BLOCK_SIZE) / 8 + 128 + 2); - upper_bound_sample = total_samples; + upper_bound_sample = total_samples > 0 ? total_samples : target_sam...
2015 Jun 16
0
Low-level seek routines in libFLAC
...(they are shown below). seek_to_absolute_sample_() can be easily modified to use those functions, and we won't change its behaviour. The user code that uses those functions might look like this: void foo() { FLAC__uint64 offset; FLAC__stream_decoder_seek_prepare(decoder, target_sample, stream_length); for (;;) { FLAC__stream_decoder_seek(decoder, &offset); my_seek(file, offset); FLAC__stream_decoder_process_single(decoder); if /* write() callback was called - seek has been completed */ { puts("seek OK"); break; } } } I always like to contr...
2004 Sep 10
2
flac_read callback not called in Windows?
...amDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) { *absolute_byte_offset = mame_ftell(flacFile); return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; } static FLAC__SeekableStreamDecoderLengthStatus flac_length(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) { *stream_length = mame_fsize(flacFile); return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; } static FLAC__bool flac_eof(const FLAC__SeekableStreamDecoder *decoder, void *client_data) { return(osd_feof(flacFile)); } static FLAC__StreamDecoderWriteStatus flac_write(cons...
2006 May 11
2
C++ Set_Metadata Problem
I refer to a problem that appeared on the flac list last August that was either solved off-list or abandoned. (http://lists.xiph.org/pipermail/flac/2005-August/000468.html) The problem is with using the C++ encoder classes, particularly the FLAC::Encoder::File:set_metadata function. JC said that the developers version of how to add a simple metadata block looked right, but it did not work for