shithub: sox

Download patch

ref: e29e9ceb7c25a2d83c09bc8a601de117fc65563c
parent: fdfceb50375dd40150d5a4e91a55a8b027313500
author: Doug Cook <idigdoug@users.sourceforge.net>
date: Mon Mar 21 20:59:35 EDT 2011

Improved large file support

Thanks to Thor Andreassen for getting this started and helping with validation.

sox.h:
- Change SOX_IGNORE_LENGTH to uint64_t
- Change sox_signalinfo_t length to uint64_t
- Change sox_loopinfo_t start and length to uint64_t
- Change sox_format_t olength, tell_off, data_start to uint64_t
- Change sox_trim_get_start and sox_crop_get_start to return uint64_t

sox_i.h:
- Optimize lsx_swapw and lsx_swapdw to use MSVC built-in versions
- Change lsx_filelength to return uint64_t
- Change lsx_check_read_params to take uint64_t for num_samples parameter
- Change div_bits to return uint64_t instead of off_t
- Change lsx_rawstart parameter name for clarity

Formats minimally updated to try to be 64-bit aware; on overflow:
- aiff prints warning then stores UINT_MAX for file length
- aifc prints warning then stores UINT_MAX for file length
- au writes SUN_UNSPEC
- htk prints warning then stores UINT_MAX for file length
- mp3 prints warning then stores 0 for length if length is greater than
  ULONG_MAX. (Can this be improved for systems where long=32bits?)
- smp stores UINT_MAX for loop start and end and file header.
- wve stores 0 for file length

Crop, fade, and trim effects got some attention. Other effects were untouched.
Probably some additional work needed for validating effects on large files.

Additional work that could be done:
- improve warnings and validation when 64-bit values truncated to 32-bit
- fix lsx_parsesamples to use uint64_t
- replace off_t with int64_t