diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-10-18 18:20:32 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-10-18 18:20:32 +0000 |
commit | c943f602717e4c820a8e4269954ab9c03dc7e6ba (patch) | |
tree | 4006b9a777bcd004bbc99ab86871da6f82cb7f25 | |
parent | ef1550b3d1959dcf1ad46f88b5ce7ff90039fc4f (diff) | |
download | xine-lib-c943f602717e4c820a8e4269954ab9c03dc7e6ba.tar.gz xine-lib-c943f602717e4c820a8e4269954ab9c03dc7e6ba.tar.bz2 |
8 bits .au support (fixes Rendezvous2.au)
CVS patchset: 7045
CVS date: 2004/10/18 18:20:32
-rw-r--r-- | src/demuxers/demux_snd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index e1fcdf399..c1925bc71 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -21,7 +21,7 @@ /* * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_snd.c,v 1.39 2004/06/13 21:28:54 miguelfreitas Exp $ + * $Id: demux_snd.c,v 1.40 2004/10/18 18:20:32 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -114,6 +114,16 @@ static int open_snd_file(demux_snd_t *this) { this->audio_bytes_per_second = this->audio_channels * this->audio_sample_rate; break; + + case 2: + this->audio_type = BUF_AUDIO_LPCM_BE; + this->audio_bits = 8; + this->audio_frames = this->data_size / + (this->audio_channels * this->audio_bits / 8); + this->audio_block_align = PCM_BLOCK_ALIGN; + this->audio_bytes_per_second = this->audio_channels * + (this->audio_bits / 8) * this->audio_sample_rate; + break; case 3: this->audio_type = BUF_AUDIO_LPCM_BE; @@ -193,6 +203,13 @@ static int demux_snd_send_chunk(demux_plugin_t *this_gen) { if (!remaining_sample_bytes) buf->decoder_flags |= BUF_FLAG_FRAME_END; + /* convert 8-bit signed -> unsigned */ + if (this->audio_bits == 8) { + int i; + for (i = 0; i < buf->size; i++) + buf->content[i] += 0x80; + } + this->audio_fifo->put (this->audio_fifo, buf); } return this->status; |