diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-11-17 17:55:02 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-11-17 17:55:02 +0000 |
commit | 2a8eacdbfc5d98b016c480ddaddff100301f721f (patch) | |
tree | 69c79430463bb43c0e3ce96fbef851de6c35b277 /firmware/export/audio.h | |
parent | 91206954aa0818e0790857f25f46a53d8e737a20 (diff) | |
download | rockbox-2a8eacdbfc5d98b016c480ddaddff100301f721f.tar.gz rockbox-2a8eacdbfc5d98b016c480ddaddff100301f721f.zip |
Buflib: Make shrinking and buflib_available() smarter.
* shrinking now considers freespace just before the alloc-to-be-shrinked,
that means less (or sometimes none at all) is taken from the audio buffer.
* core_available() now searches for the best free space, instead of simply the end,
i.e. it will not return 0 if the audio buffer is allocated and there's free space
before it. It also runs a compaction to ensure maximum contiguous memory.
audio_buffer_available() is also enhanced. It now considers the 256K reserve buffer,
and returns free buflib space instead if the audio buffer is short.
This all fixes the root problem of FS#12344 (Sansa Clip+: PANIC occurred when
dircache is enabled), that alloced from the audio buffer, even if it was very
short and buflib had many more available as free space before it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/audio.h')
-rw-r--r-- | firmware/export/audio.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 57f3c24aae..5309ddd1d1 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h | |||
@@ -58,6 +58,10 @@ void audio_resume(void); | |||
58 | void audio_next(void); | 58 | void audio_next(void); |
59 | void audio_prev(void); | 59 | void audio_prev(void); |
60 | int audio_status(void); | 60 | int audio_status(void); |
61 | /* size of the audio buffer */ | ||
62 | size_t audio_buffer_size(void); | ||
63 | /* size of the buffer available for allocating memory from the audio buffer using core_*() | ||
64 | * returns core_available() if audio buffer is not allocated yet */ | ||
61 | size_t audio_buffer_available(void); | 65 | size_t audio_buffer_available(void); |
62 | void audio_ff_rewind(long newpos); | 66 | void audio_ff_rewind(long newpos); |
63 | void audio_flush_and_reload_tracks(void); | 67 | void audio_flush_and_reload_tracks(void); |