[flac-dev] 2GB limit patch
Brian Willoughby
brianw at sounds.wa.com
Wed Mar 6 01:02:33 PST 2013
On Mar 6, 2013, at 00:55, Erik de Castro Lopo wrote:
> Brian Willoughby wrote:
>
>> I do not see the need to jump to 64-bit merely to get beyond the 2 GB
>> limit. There are modern API that handle 32-bit unsigned file lengths
>> - i.e., up to 4 GB - without going to 64-bit.
>
> When we are talking about offset_t we are talking about the flac C and
> C++ API. Currently if we have a flac file with more than 2Gig samples
> it is not possible to seek past the 2 Gig sample point on platforms
> where offset_t is 32 bit. To fix this we need to guarantee that the
> offset parameter is 64 bits on all platforms.
What about fseeko()? I use that in my ObjC library for converting
between AIFF, FLAC, and WAVE. It takes an unsigned 32-bit offset, as
contrasted with fseek() classic. Unless you need negative offsets,
that seems like a simple change.
FLAC__stream_decoder_seek_absolute() already takes a FLAC__uint64
offset. I just cast my 32-bit unsigned long and use that in the
existing FLAC API.
Brian Willoughby
Sound Consulting
More information about the flac-dev
mailing list