1
0
Fork 0
forked from len0rd/rockbox

Fixed problems with playlist buffer full handling

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9454 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Hardeep Sidhu 2006-04-03 14:25:47 +00:00
parent 30db2b4ac3
commit 6dd728cdea

View file

@ -457,6 +457,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
unsigned int count = 0; unsigned int count = 0;
bool store_index; bool store_index;
unsigned char *p; unsigned char *p;
int result = 0;
if(-1 == playlist->fd) if(-1 == playlist->fd)
playlist->fd = open(playlist->filename, O_RDONLY); playlist->fd = open(playlist->filename, O_RDONLY);
@ -506,16 +507,18 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
if(*p != '#') if(*p != '#')
{ {
if ( playlist->amount >= playlist->max_playlist_size ) {
display_buffer_full();
result = -1;
goto exit;
}
/* Store a new entry */ /* Store a new entry */
playlist->indices[ playlist->amount ] = i+count; playlist->indices[ playlist->amount ] = i+count;
#ifdef HAVE_DIRCACHE #ifdef HAVE_DIRCACHE
if (playlist->filenames) if (playlist->filenames)
playlist->filenames[ playlist->amount ] = NULL; playlist->filenames[ playlist->amount ] = NULL;
#endif #endif
if ( playlist->amount >= playlist->max_playlist_size ) {
display_buffer_full();
return -1;
}
playlist->amount++; playlist->amount++;
} }
} }
@ -524,11 +527,12 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
i+= count; i+= count;
} }
exit:
#ifdef HAVE_DIRCACHE #ifdef HAVE_DIRCACHE
queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0); queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0);
#endif #endif
return 0; return result;
} }
/* /*