pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
D'oh, we were reading 16 bit integers instead of 32 bit integers! That caused silence when trying to play a 32 bit input file on a 24 bit sound card (e.g. USB sound chips with 24 bit packed samples).
This commit is contained in:
parent
5469941f2b
commit
5cf4ce9318
1
NEWS
1
NEWS
@ -1,4 +1,5 @@
|
|||||||
ver 0.16.5 (2010/??/??)
|
ver 0.16.5 (2010/??/??)
|
||||||
|
* pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
|
||||||
|
|
||||||
|
|
||||||
ver 0.16.4 (2011/09/01)
|
ver 0.16.4 (2011/09/01)
|
||||||
|
@ -143,7 +143,7 @@ pcm_convert_16_to_24(int32_t *out, const int16_t *in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pcm_convert_32_to_24(int32_t *out, const int16_t *in,
|
pcm_convert_32_to_24(int32_t *out, const int32_t *in,
|
||||||
unsigned num_samples)
|
unsigned num_samples)
|
||||||
{
|
{
|
||||||
while (num_samples > 0) {
|
while (num_samples > 0) {
|
||||||
@ -197,7 +197,7 @@ pcm_convert_to_24(struct pcm_buffer *buffer,
|
|||||||
*dest_size_r = num_samples * sizeof(*dest);
|
*dest_size_r = num_samples * sizeof(*dest);
|
||||||
dest = pcm_buffer_get(buffer, *dest_size_r);
|
dest = pcm_buffer_get(buffer, *dest_size_r);
|
||||||
|
|
||||||
pcm_convert_32_to_24(dest, (const int16_t *)src,
|
pcm_convert_32_to_24(dest, (const int32_t *)src,
|
||||||
num_samples);
|
num_samples);
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user