diff options
Diffstat (limited to 'apps/codecs/libwavpack/unpack.c')
-rw-r--r-- | apps/codecs/libwavpack/unpack.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/codecs/libwavpack/unpack.c b/apps/codecs/libwavpack/unpack.c index f2eca7619f..69252f24ad 100644 --- a/apps/codecs/libwavpack/unpack.c +++ b/apps/codecs/libwavpack/unpack.c | |||
@@ -270,6 +270,22 @@ int read_config_info (WavpackContext *wpc, WavpackMetadata *wpmd) | |||
270 | return TRUE; | 270 | return TRUE; |
271 | } | 271 | } |
272 | 272 | ||
273 | // Read non-standard sampling rate from metadata. | ||
274 | |||
275 | int read_sample_rate (WavpackContext *wpc, WavpackMetadata *wpmd) | ||
276 | { | ||
277 | int bytecnt = wpmd->byte_length; | ||
278 | uchar *byteptr = wpmd->data; | ||
279 | |||
280 | if (bytecnt == 3) { | ||
281 | wpc->config.sample_rate = (int32_t) *byteptr++; | ||
282 | wpc->config.sample_rate |= (int32_t) *byteptr++ << 8; | ||
283 | wpc->config.sample_rate |= (int32_t) *byteptr++ << 16; | ||
284 | } | ||
285 | |||
286 | return TRUE; | ||
287 | } | ||
288 | |||
273 | // This monster actually unpacks the WavPack bitstream(s) into the specified | 289 | // This monster actually unpacks the WavPack bitstream(s) into the specified |
274 | // buffer as 32-bit integers or floats (depending on orignal data). Lossy | 290 | // buffer as 32-bit integers or floats (depending on orignal data). Lossy |
275 | // samples will be clipped to their original limits (i.e. 8-bit samples are | 291 | // samples will be clipped to their original limits (i.e. 8-bit samples are |