summaryrefslogtreecommitdiffstats
path: root/adpcm.c
diff options
context:
space:
mode:
authormelanson <melanson@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-29 04:20:29 +0000
committermelanson <melanson@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-29 04:20:29 +0000
commit52668414f9adef6cac8301a85bca172a77f78228 (patch)
treef5d33426a9d6950c8fe6af4487a66a3a4a10b0b7 /adpcm.c
parentfa669fa2ee90acaf38fc2febef9ffeb19c4f48f0 (diff)
downloadmpv-52668414f9adef6cac8301a85bca172a77f78228.tar.bz2
mpv-52668414f9adef6cac8301a85bca172a77f78228.tar.xz
fixed stereo MS ADPCM decoder and reinstated opensource decoder as the
default handler for MS ADPCM data git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3876 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'adpcm.c')
-rw-r--r--adpcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/adpcm.c b/adpcm.c
index ec82a6856c..37bbd64461 100644
--- a/adpcm.c
+++ b/adpcm.c
@@ -211,7 +211,7 @@ int ima_adpcm_decode_block(unsigned short *output, unsigned char *input,
}
int ms_adpcm_decode_block(unsigned short *output, unsigned char *input,
- int channels)
+ int channels, int block_size)
{
int current_channel = 0;
int idelta[2];
@@ -267,7 +267,7 @@ int ms_adpcm_decode_block(unsigned short *output, unsigned char *input,
SE_16BIT(sample2[1]);
}
- while (stream_ptr < MS_ADPCM_BLOCK_SIZE * channels)
+ while (stream_ptr < block_size)
{
// get the next nibble
if (upper_nibble)
@@ -295,7 +295,7 @@ int ms_adpcm_decode_block(unsigned short *output, unsigned char *input,
current_channel ^= channels - 1;
}
- return MS_ADPCM_SAMPLES_PER_BLOCK * channels;
+ return (block_size - (MS_ADPCM_PREAMBLE_SIZE * channels)) * 2;
}
// note: This decoder assumes the format 0x62 data always comes in