From 4978e3255c01c82a38f0e564ea43ad7d6cefdfd4 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <PromyLOPh@gmail.com>
Date: Fri, 27 Jun 2008 08:27:15 +0200
Subject: client: Fix wrong length calculation

---
 src/player.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/player.c b/src/player.c
index 6861a9a..d70b63f 100644
--- a/src/player.c
+++ b/src/player.c
@@ -89,8 +89,9 @@ size_t BarPlayerCurlCb (void *ptr, size_t size, size_t nmemb, void *stream) {
 						NeAACDecGetErrorMessage (frameInfo.error));
 				break;
 			}
+			/* ao_play needs bytes: 1 sample = 16 bits = 2 bytes */
 			ao_play (player->audioOutDevice, aacDecoded,
-					frameInfo.samples*frameInfo.channels);
+					frameInfo.samples * 16 / 8);
 			player->bufferRead += frameInfo.bytesconsumed;
 			player->sampleSizeCurr++;
 			/* going through this loop can take up to a few seconds =>
-- 
cgit v1.2.3