summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2010-08-11 19:01:50 +0000
committerMagnus Holmgren <magnushol@gmail.com>2010-08-11 19:01:50 +0000
commit113764d9c0dad33beab8ece9a9073c8648bd9da6 (patch)
tree3411fcb376adcbcb15ec3dc37bc95bb698af7ace /apps/tree.c
parentde44ae7efcf907c8aa52475a7c0dd9f0da22045e (diff)
downloadrockbox-113764d9c0dad33beab8ece9a9073c8648bd9da6.tar.gz
rockbox-113764d9c0dad33beab8ece9a9073c8648bd9da6.tar.bz2
rockbox-113764d9c0dad33beab8ece9a9073c8648bd9da6.zip
Fix FS#11175. playlist_peek() wasn't thread safe (due to a static filename buffer), so frequent calls from the main thread would cause the audio thread to buffer the wrong track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27773 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c
index c2ec4ca3ec..f8874f684e 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1075,6 +1075,7 @@ bool bookmark_play(char *resume_file, int index, int offset, int seed,
lastdir[0]='\0';
if (playlist_create(resume_file, NULL) != -1)
{
+ char filename_buf[MAX_PATH + 1];
const char* peek_filename;
resume_directory(resume_file);
if (global_settings.playlist_shuffle)
@@ -1082,13 +1083,15 @@ bool bookmark_play(char *resume_file, int index, int offset, int seed,
/* Check if the file is at the same spot in the directory,
else search for it */
- peek_filename = playlist_peek(index);
+ peek_filename = playlist_peek(index, filename_buf,
+ sizeof(filename_buf));
if (peek_filename == NULL)
{
/* playlist has shrunk, search from the top */
index = 0;
- peek_filename = playlist_peek(index);
+ peek_filename = playlist_peek(index, filename_buf,
+ sizeof(filename_buf));
if (peek_filename == NULL)
return false;
}
@@ -1097,7 +1100,8 @@ bool bookmark_play(char *resume_file, int index, int offset, int seed,
{
for ( i=0; i < playlist_amount(); i++ )
{
- peek_filename = playlist_peek(i);
+ peek_filename = playlist_peek(i, filename_buf,
+ sizeof(filename_buf));
if (peek_filename == NULL)
return false;