summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-27 08:27:15 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-27 08:27:15 +0200
commit4978e3255c01c82a38f0e564ea43ad7d6cefdfd4 (patch)
tree80b34aa8cf4739f935fe8fdf56edfcb3a7ef416e
parentd8bef9f721661e2bc538a5f2198bdf8d0dd84a9c (diff)
downloadpianobar-windows-4978e3255c01c82a38f0e564ea43ad7d6cefdfd4.tar.gz
pianobar-windows-4978e3255c01c82a38f0e564ea43ad7d6cefdfd4.tar.bz2
pianobar-windows-4978e3255c01c82a38f0e564ea43ad7d6cefdfd4.zip
client: Fix wrong length calculation
-rw-r--r--src/player.c3
1 files changed, 2 insertions, 1 deletions
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 =>