summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-10-30 20:01:06 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-10-30 20:01:06 +0100
commit83046ec71aee327257930adb4f4baf45369370a5 (patch)
tree71218f66f86494617240a176e6ebcc275466363d /sbc
parent775f13d1b9d28a0aed399f8853018ba68e04bd38 (diff)
Fix SBC decoding handling
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbcdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbc/sbcdec.c b/sbc/sbcdec.c
index 555ace54..2464c421 100644
--- a/sbc/sbcdec.c
+++ b/sbc/sbcdec.c
@@ -157,7 +157,7 @@ static void decode(char *filename, char *output, int tofile)
}
}
- count = 0;
+ count = len;
while (framelen > 0) {
/* we have completed an sbc_decode at this point sbc.len is the
* length of the frame we just decoded count is the number of
@@ -179,15 +179,15 @@ static void decode(char *filename, char *output, int tofile)
exit(1);
}
- /* increase the count */
- count += len;
-
/* push the pointer in the file forward to the next bit to be
* decoded tell the decoder to decode up to the remaining
* length of the file (!) */
pos += framelen;
framelen = sbc_decode(&sbc, stream + pos, streamlen - pos,
buf + count, sizeof(buf) - count, &len);
+
+ /* increase the count */
+ count += len;
}
if (count > 0) {