/* The output buffers containing the decoded samples (channels 0 and 1) */ int32_t decoded0[MAX_BLOCKSIZE] IBSS_ATTR; int32_t decoded1[MAX_BLOCKSIZE] IBSS_ATTR; #define MAX_SUPPORTED_SEEKTABLE_SIZE 5000 /* Notes about seeking: The full seek table consists of: uint64_t sample (only 36 bits are used) uint64_t offset uint32_t blocksize We don't store the blocksize (of the target frame) and we also limit the sample and offset values to 32-bits - Rockbox doesn't support files bigger than 2GB on FAT32 filesystems. The reference FLAC encoder produces a seek table with points every 10 seconds, but this can be overridden by the user when encoding a file. With the default settings, a typical 4 minute track will contain 24 seek points. Taking the extreme case of a Rockbox supported file to be a 2GB (compressed) 16-bit/44.1KHz mono stream with a likely uncompressed size of 4GB: Total duration is: 48694 seconds (about 810 minutes - 13.5 hours) Total number of seek points: 4869 Therefore we limit the number of seek points to 5000. This is a very extreme case, and requires 5000*8=40000 bytes of storage. If we come across a FLAC file with more than this number of seekpoints, we just use the first 5000.