summaryrefslogtreecommitdiffstats
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-02-13 11:02:37 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-02-13 11:02:37 +0000
commitefdf49668e1784400008062077f1335784818c9c (patch)
tree3ce720b575484fca1c3a85dc36a7994034d3994d /apps/buffering.c
parent78a71d4701bdcfdce3f1f744c02990a2c3b71dd0 (diff)
downloadrockbox-efdf49668e1784400008062077f1335784818c9c.tar.gz
rockbox-efdf49668e1784400008062077f1335784818c9c.tar.bz2
rockbox-efdf49668e1784400008062077f1335784818c9c.zip
Needed to do a few more things to have r29291 correct.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29294 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
-rw-r--r--apps/buffering.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 213826fda0..85028dc8e6 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -250,7 +250,7 @@ static struct memory_handle *add_handle(size_t data_size, bool can_wrap,
/* gives each handle a unique id */
static int cur_handle_id = 0;
size_t shift;
- size_t new_widx;
+ size_t widx, new_widx;
size_t len;
ssize_t overlap;
@@ -260,7 +260,7 @@ static struct memory_handle *add_handle(size_t data_size, bool can_wrap,
mutex_lock(&llist_mutex);
mutex_lock(&llist_mod_mutex);
- new_widx = buf_widx;
+ widx = buf_widx;
if (cur_handle && cur_handle->filerem > 0) {
/* the current handle hasn't finished buffering. We can only add
@@ -274,12 +274,12 @@ static struct memory_handle *add_handle(size_t data_size, bool can_wrap,
return NULL;
} else {
/* Allocate the remainder of the space for the current handle */
- new_widx = ringbuf_add(cur_handle->widx, cur_handle->filerem);
+ widx = ringbuf_add(cur_handle->widx, cur_handle->filerem);
}
}
/* align to 4 bytes up */
- new_widx = ringbuf_add(new_widx, 3) & ~3;
+ new_widx = ringbuf_add(widx, 3) & ~3;
len = data_size + sizeof(struct memory_handle);
@@ -291,11 +291,11 @@ static struct memory_handle *add_handle(size_t data_size, bool can_wrap,
new_widx = 0;
}
- /* How far we shifted buf_widx to align things, must be < buffer_len */
- shift = ringbuf_sub(new_widx, buf_widx);
+ /* How far we shifted the new_widx to align things, must be < buffer_len */
+ shift = ringbuf_sub(new_widx, widx);
/* How much space are we short in the actual ring buffer? */
- overlap = ringbuf_add_cross(buf_widx, shift + len, buf_ridx);
+ overlap = ringbuf_add_cross(widx, shift + len, buf_ridx);
if (overlap >= 0 && (alloc_all || (size_t)overlap >= data_size)) {
/* Not enough space for required allocations */
mutex_unlock(&llist_mod_mutex);