diff options
author | Mike Melanson <mike@multimedia.cx> | 2003-01-06 06:06:52 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2003-01-06 06:06:52 +0000 |
commit | f01fa02a49c2f9393e6d2f4cd4b6ca723318bc80 (patch) | |
tree | d525276c07d3e959f360948a01f5a9837ebecb84 /src | |
parent | dec505a140e8a34d6aa40d354906af8012d1f3cc (diff) | |
download | xine-lib-f01fa02a49c2f9393e6d2f4cd4b6ca723318bc80.tar.gz xine-lib-f01fa02a49c2f9393e6d2f4cd4b6ca723318bc80.tar.bz2 |
convert 8-bit PCM data from signed -> unsigned
CVS patchset: 3798
CVS date: 2003/01/06 06:06:52
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_aiff.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 9f68ad6ff..57e1c5e4b 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -19,7 +19,7 @@ * * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.21 2003/01/04 14:48:11 miguelfreitas Exp $ + * $Id: demux_aiff.c,v 1.22 2003/01/06 06:06:52 tmmm Exp $ * */ @@ -186,6 +186,7 @@ static int demux_aiff_send_chunk (demux_plugin_t *this_gen) { unsigned int remaining_sample_bytes; off_t current_file_pos; int64_t current_pts; + int i; /* just load data chunks from wherever the stream happens to be * pointing; issue a DEMUX_FINISHED status if EOF is reached */ @@ -218,11 +219,16 @@ static int demux_aiff_send_chunk (demux_plugin_t *this_gen) { if (this->input->read(this->input, buf->content, buf->size) != buf->size) { - buf->free_buffer(buf); + buf->free_buffer(buf); this->status = DEMUX_FINISHED; break; } + /* convert 8-bit signed -> unsigned */ + if (this->audio_bits == 8) + for (i = 0; i < buf->size; i++) + buf->content[i] += 0x80; + if (!remaining_sample_bytes) buf->decoder_flags |= BUF_FLAG_FRAME_END; |