1
0
Fork 0
forked from len0rd/rockbox

Move WavPack metadata parsing to its own file and add handling of non-standard sampling rates

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14289 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Bryant 2007-08-12 06:36:06 +00:00
parent 53095684f7
commit bcf97a4801
8 changed files with 148 additions and 61 deletions

View file

@ -270,6 +270,22 @@ int read_config_info (WavpackContext *wpc, WavpackMetadata *wpmd)
return TRUE;
}
// Read non-standard sampling rate from metadata.
int read_sample_rate (WavpackContext *wpc, WavpackMetadata *wpmd)
{
int bytecnt = wpmd->byte_length;
uchar *byteptr = wpmd->data;
if (bytecnt == 3) {
wpc->config.sample_rate = (int32_t) *byteptr++;
wpc->config.sample_rate |= (int32_t) *byteptr++ << 8;
wpc->config.sample_rate |= (int32_t) *byteptr++ << 16;
}
return TRUE;
}
// This monster actually unpacks the WavPack bitstream(s) into the specified
// buffer as 32-bit integers or floats (depending on orignal data). Lossy
// samples will be clipped to their original limits (i.e. 8-bit samples are