diff options
author | Mike Melanson <mike@multimedia.cx> | 2003-01-04 19:35:15 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2003-01-04 19:35:15 +0000 |
commit | 886e361fca242fbfea5c69ecf514aa0fdd5e183d (patch) | |
tree | 5adf487707548f4efb592173e5cc3ed30e31c780 | |
parent | a194e2baebc2accdebb52e74c796deb857019cd0 (diff) | |
download | xine-lib-886e361fca242fbfea5c69ecf514aa0fdd5e183d.tar.gz xine-lib-886e361fca242fbfea5c69ecf514aa0fdd5e183d.tar.bz2 |
sign the 8-bit data
CVS patchset: 3774
CVS date: 2003/01/04 19:35:15
-rw-r--r-- | src/post/goom/xine_goom.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 155cdb61b..e16f6ed36 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_goom.c,v 1.17 2003/01/03 23:40:46 miguelfreitas Exp $ + * $Id: xine_goom.c,v 1.18 2003/01/04 19:35:15 tmmm Exp $ * * GOOM post plugin. * @@ -386,10 +386,11 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen, if( this->bits == 8 ) { data8 = (int8_t *)buf->mem; - for( i = 0; i < buf->num_frames && this->data_idx < 512; + /* scale 8 bit data to 16 bits and convert to signed as well */ + for( i = 0; i < buf->num_frames && this->data_idx < 512; i++, this->data_idx++, data8 += this->channels ) { - this->data[0][this->data_idx] = (int16_t)data8[0] << 8; - this->data[1][this->data_idx] = (int16_t)data8[j] << 8; + this->data[0][this->data_idx] = ((int16_t)data8[0] << 8) - 0x8000; + this->data[1][this->data_idx] = ((int16_t)data8[j] << 8) - 0x8000; } } else { data = buf->mem; |