From 8c7286fec075e2636781f118350263dfd53c006f Mon Sep 17 00:00:00 2001 From: nicodvb Date: Fri, 21 Jan 2005 07:22:04 +0000 Subject: [PATCH] fixed wrong deinterleaving of channels git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14551 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ae_toolame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/ae_toolame.c b/libmpcodecs/ae_toolame.c index a911b224d6..d717f6943f 100644 --- a/libmpcodecs/ae_toolame.c +++ b/libmpcodecs/ae_toolame.c @@ -119,8 +119,8 @@ int mpae_encode_toolame(mpae_toolame_ctx *ctx, uint8_t *dest, int nsamples, void buffer = (uint16_t *) src; for(i = 0; i < nsamples; i++) { - ctx->left_pcm[i] = buffer[2 * i]; - ctx->right_pcm[i] = buffer[2 * i + (ctx->channels - 1)]; + ctx->left_pcm[i] = buffer[ctx->channels * i]; + ctx->right_pcm[i] = buffer[(ctx->channels * i) + (ctx->channels - 1)]; } toolame_encode_buffer(ctx->toolame_ctx, ctx->left_pcm, ctx->right_pcm, nsamples, dest, max_size, &ret_size);