thats why i say that there seems to be a file size bug >2GiB
maybe everything above 2GiB of a file is lost and misplaced
the seek call
> FIO_SeekFile(save_file, 0, SEEK_END);
seems not to seek to the end correctly. i know it wont handle positions > 2GiB if passed as parameter.
dmilligan could use the one i use for mlv_play to seek correctly:
/* as soon all cameras provide FIO_SeekSkipFile, we can remove that temporary code */
static uint64_t FIO_SeekSkipFile_emulate(FILE* stream, uint64_t position, int whence)
{
const uint32_t maxOffset = 0x7FFFFFFF;
/* the OS routine FIO_SeekFile only accepts signed integers as position, so work around to position absolutely */
if(whence == SEEK_SET && position > maxOffset)
{
FIO_SeekFile(stream, 0, SEEK_SET);
while(position > maxOffset)
{
FIO_SeekFile(stream, maxOffset, SEEK_CUR);
position -= maxOffset;
}
return FIO_SeekFile(stream, (uint32_t)position, SEEK_CUR);
}
return FIO_SeekFile(stream, (uint32_t)position, whence);
}