Commit 0435cb98 authored by Sam Hocevar's avatar Sam Hocevar

* Fix U16toFloat32() and U16toS16().

parent d1a171cf
...@@ -423,7 +423,7 @@ static block_t *S16toFloat32( filter_t *p_filter, block_t *p_block ) ...@@ -423,7 +423,7 @@ static block_t *S16toFloat32( filter_t *p_filter, block_t *p_block )
static block_t *U16toFloat32( filter_t *p_filter, block_t *p_block ) static block_t *U16toFloat32( filter_t *p_filter, block_t *p_block )
{ {
block_t *p_block_out; block_t *p_block_out;
int16_t *p_in; uint16_t *p_in;
float *p_out; float *p_out;
int i; int i;
...@@ -435,7 +435,7 @@ static block_t *U16toFloat32( filter_t *p_filter, block_t *p_block ) ...@@ -435,7 +435,7 @@ static block_t *U16toFloat32( filter_t *p_filter, block_t *p_block )
return NULL; return NULL;
} }
p_in = (int16_t *)p_block->p_buffer; p_in = (uint16_t *)p_block->p_buffer;
p_out = (float *)p_block_out->p_buffer; p_out = (float *)p_block_out->p_buffer;
for( i = p_block->i_buffer / 2; i--; ) for( i = p_block->i_buffer / 2; i--; )
...@@ -556,8 +556,8 @@ static block_t *U16toU8( filter_t *p_filter, block_t *p_block ) ...@@ -556,8 +556,8 @@ static block_t *U16toU8( filter_t *p_filter, block_t *p_block )
static block_t *U16toS16( filter_t *p_filter, block_t *p_block ) static block_t *U16toS16( filter_t *p_filter, block_t *p_block )
{ {
int i; int i;
int16_t *p_in = (int16_t *)p_block->p_buffer; uint16_t *p_in = (uint16_t *)p_block->p_buffer;
uint16_t *p_out = (uint16_t *)p_in; int16_t *p_out = (int16_t *)p_in;
for( i = p_block->i_buffer / 2; i--; ) for( i = p_block->i_buffer / 2; i--; )
*p_out++ = (int)(*p_in++) - 32768; *p_out++ = (int)(*p_in++) - 32768;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment