(2013/03/05 12:27), Cristian Rodr?guez wrote:> Nothing against you code, that's ugly ..but as it is a first step it can > be forgiven :-) > > I will just force flac to be built with 64 bit file offsets and just > reject any caller trying to include/link libflac into a non-lfs program > like > > http://ac-archive.sourceforge.net/largefile/off_t_headers.html > > Then we can fix all the internal problems, without the need of > typedef'ing around ;)Well, I'm afraid typedef'ing or something is mandatory for large file support on win32, since off_t is *always* 32bit on win32 and flac basically uses off_t everywhere for seek offset and file size.
nu774 wrote:> (2013/03/05 12:27), Cristian Rodr?guez wrote: > > Nothing against you code, that's ugly ..but as it is a first step it can > > be forgiven :-) > > > > I will just force flac to be built with 64 bit file offsets and just > > reject any caller trying to include/link libflac into a non-lfs program > > like > > > > http://ac-archive.sourceforge.net/largefile/off_t_headers.html > > > > Then we can fix all the internal problems, without the need of > > typedef'ing around ;) > > Well, I'm afraid typedef'ing or something is mandatory for large file > support on win32, since off_t is *always* 32bit on win32 and flac > basically uses off_t everywhere for seek offset and file size.This requires an API change and hence is something that will need to wait for the next release. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
On Mar 4, 2013, at 20:03, nu774 wrote:> (2013/03/05 12:27), Cristian Rodr?guez wrote: >> Nothing against you code, that's ugly ..but as it is a first step >> it can >> be forgiven :-) >> >> I will just force flac to be built with 64 bit file offsets and just >> reject any caller trying to include/link libflac into a non-lfs >> program >> like >> >> http://ac-archive.sourceforge.net/largefile/off_t_headers.html >> >> Then we can fix all the internal problems, without the need of >> typedef'ing around ;) > > Well, I'm afraid typedef'ing or something is mandatory for large file > support on win32, since off_t is *always* 32bit on win32 and flac > basically uses off_t everywhere for seek offset and file size.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. Besides, RF64 is the proper format for files that exceed 4 GB, while standard RIFF/WAVE should allow reading of files up to 4 GB. For maximum compatibility, writing WAV files over 2 GB should be avoided whenever possible, since so many tools used signed 32-bit file sizes. Brian Willoughby Sound Consulting
On Mar 4, 2013, at 22:50, Erik de Castro Lopo wrote:> nu774 wrote: >> (2013/03/05 12:27), Cristian Rodr?guez wrote: >>> Nothing against you code, that's ugly ..but as it is a first step >>> it can >>> be forgiven :-) >>> >>> I will just force flac to be built with 64 bit file offsets and just >>> reject any caller trying to include/link libflac into a non-lfs >>> program >>> like >>> >>> http://ac-archive.sourceforge.net/largefile/off_t_headers.html >>> >>> Then we can fix all the internal problems, without the need of >>> typedef'ing around ;) >> >> Well, I'm afraid typedef'ing or something is mandatory for large file >> support on win32, since off_t is *always* 32bit on win32 and flac >> basically uses off_t everywhere for seek offset and file size. > > This requires an API change and hence is something that will need to > wait for the next release.This thread started on the topic of WAV files exceeding 2 GB. The FLAC API would only need to change if the FLAC file size limits were altered. Besides, I believe that FLAC is supposed to be a stream with no maximum size limit. No API changes should be necessary for the command-line FLAC to support 4 GB WAV files. Did I miss something? Brian Willoughby Sound Consulting
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. Correctly converting WAV files larger than 2 (or 4) Gig is a separate issue.> Besides, RF64 is the proper format for files that exceed 4 GB, while > standard RIFF/WAVE should allow reading of files up to 4 GB.When talking about the WAV 2/4 Gig problem we are talking about mal-formed WAV files that are greater than 4 Gig in size. There is a flac command line option (--ignore-chunk-sizes) that treats everything after the start of the audio data as audio data even if the file is over 4Gig in size.> For maximum compatibility, writing WAV files over 2 GB should be > avoided whenever possible, since so many tools used signed 32-bit > file sizes.I agree completely. Unfortunately there is a lot of broken software out there. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/