path: root/apps/playlist.h
diff options
authorThomas Martitz <>2011-08-30 14:01:45 +0000
committerThomas Martitz <>2011-08-30 14:01:45 +0000
commitbaa070cca6d459a7c5aed81f29e4cc4f6c7410b3 (patch)
tree5123360aea420b96e4a97a8e88cf51b4277152d9 /apps/playlist.h
parentd0b72e25903574acb1cf9184a6052cdd646dbc37 (diff)
GSoC/Buflib: Enable compaction in buflib.
This enables the ability to allocate (and free) memory dynamically without fragmentation, through compaction. This means allocations can move and fragmentation be reduced. Most changes are preparing Rockbox for this, which many times means adding a move callback which can temporarily disable movement when the corresponding code is in a critical section. For now, the audio buffer allocation has a central role, because it's the one having allocated most. This buffer is able to shrink itself, for which it needs to stop playback for a very short moment. For this, audio_buffer_available() returns the size of the audio buffer which can possibly be used by other allocations because the audio buffer can shrink. lastfm scrobbling and timestretch can now be toggled at runtime without requiring a reboot. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.h')
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/playlist.h b/apps/playlist.h
index f14b5c6460..6dd5535df1 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -80,15 +80,16 @@ struct playlist_info
int control_fd; /* descriptor of the open control file */
bool control_created; /* has control file been created? */
int dirlen; /* Length of the path to the playlist file */
- unsigned long *indices; /* array of indices */
- int *filenames; /* Array of dircache indices */
+ volatile unsigned long *indices; /* array of indices */
+ volatile int *filenames; /* Array of dircache indices */
int max_playlist_size; /* Max number of files in playlist. Mirror of
global_settings.max_files_in_playlist */
bool in_ram; /* playlist stored in ram (dirplay) */
+ int buffer_handle; /* handle to the below buffer (-1 if non-buflib) */
union {
- char *buffer; /* buffer for in-ram playlists */
- int *seek_buf; /* buffer for seeks in real playlists */
+ volatile char *buffer;/* buffer for in-ram playlists */
+ int *seek_buf; /* buffer for seeks in real playlists */
int buffer_size; /* size of buffer */
int buffer_end_pos; /* last position where buffer was written */