summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2002-06-20 02:57:41 +0000
committerMike Melanson <mike@multimedia.cx>2002-06-20 02:57:41 +0000
commit20a3549a2f6069c2187a853b3c3304c2cab5bc00 (patch)
treecf9881afb3b3adc749b11be2ecb9c36292f92330 /src
parent1caab3bdb77bca6c079890906ad01400e558ed75 (diff)
downloadxine-lib-20a3549a2f6069c2187a853b3c3304c2cab5bc00.tar.gz
xine-lib-20a3549a2f6069c2187a853b3c3304c2cab5bc00.tar.bz2
output preamble samples for MS ADPCM decoder
CVS patchset: 2103 CVS date: 2002/06/20 02:57:41
Diffstat (limited to 'src')
-rw-r--r--src/libxineadec/adpcm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c
index 62f54ec51..3aa2c76df 100644
--- a/src/libxineadec/adpcm.c
+++ b/src/libxineadec/adpcm.c
@@ -24,7 +24,7 @@
* formats can be found here:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: adpcm.c,v 1.6 2002/06/12 04:00:28 tmmm Exp $
+ * $Id: adpcm.c,v 1.7 2002/06/20 02:57:41 tmmm Exp $
*/
#include <stdio.h>
@@ -719,6 +719,17 @@ static void ms_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) {
SE_16BIT(sample2[1]);
}
+ /* first 2 samples go directly to the output */
+ if (this->channels == 1) {
+ this->decode_buffer[out_ptr++] = sample2[0];
+ this->decode_buffer[out_ptr++] = sample1[0];
+ } else {
+ this->decode_buffer[out_ptr++] = sample2[0];
+ this->decode_buffer[out_ptr++] = sample2[1];
+ this->decode_buffer[out_ptr++] = sample1[0];
+ this->decode_buffer[out_ptr++] = sample1[1];
+ }
+
j = MS_ADPCM_PREAMBLE_SIZE * this->channels;
while (j < this->in_block_size) {
/* get the next nibble */
@@ -832,7 +843,7 @@ static void adpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
case BUF_AUDIO_MSADPCM:
this->out_block_size =
(this->in_block_size -
- (MS_ADPCM_PREAMBLE_SIZE * this->channels)) * 2;
+ ((MS_ADPCM_PREAMBLE_SIZE - 2) * this->channels)) * 2;
break;
case BUF_AUDIO_DK4ADPCM: