summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-04-25 20:32:38 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-04-25 20:32:38 +0000
commit75de60b9e86d69458ab376a6c140443c5b6dff64 (patch)
tree6eff96d3430343b7d8d9e27387bc506d233028b8 /apps/debug_menu.c
parent1191fa41fd70c57c5d093abd7dff2dd04b1a6880 (diff)
downloadrockbox-75de60b9e86d69458ab376a6c140443c5b6dff64.zip
rockbox-75de60b9e86d69458ab376a6c140443c5b6dff64.tar.gz
rockbox-75de60b9e86d69458ab376a6c140443c5b6dff64.tar.bz2
rockbox-75de60b9e86d69458ab376a6c140443c5b6dff64.tar.xz
Reduce instructions in debug audio thread loop slightly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9807 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 1bbf99d..d8f91cd 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -228,6 +228,7 @@ bool dbg_audio_thread(void)
int button;
int line;
bool done = false;
+ size_t bufused;
size_t bufsize = pcmbuf_get_bufsize();
int pcmbufdescs = pcmbuf_descs();
@@ -258,13 +259,13 @@ bool dbg_audio_thread(void)
lcd_clear_display();
- snprintf(buf, sizeof(buf), "pcm: %7ld/%7ld",
- bufsize-pcmbuf_free(), bufsize);
+ bufused = bufsize - pcmbuf_free();
+
+ snprintf(buf, sizeof(buf), "pcm: %7ld/%7ld", bufused, bufsize);
lcd_puts(0, line++, buf);
/* Playable space left */
- scrollbar(0, line*8, LCD_WIDTH, 6, bufsize, 0,
- bufsize-pcmbuf_free(), HORIZONTAL);
+ scrollbar(0, line*8, LCD_WIDTH, 6, bufsize, 0, bufused, HORIZONTAL);
line++;
snprintf(buf, sizeof(buf), "codec: %8ld/%8ld", filebufused, filebuflen);