forked from len0rd/rockbox
Whitespace and cosmetics consistency cleanup in playlist_viewer.c, no functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29694 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a0791178ae
commit
e7c6ba66aa
1 changed files with 65 additions and 64 deletions
|
|
@ -232,7 +232,7 @@ static int playlist_buffer_get_index(struct playlist_buffer *pb, int index)
|
|||
if (index >= pb->first_index)
|
||||
buffer_index = index-pb->first_index;
|
||||
else /* rotation : track0 in buffer + requested track */
|
||||
buffer_index=(viewer.num_tracks-pb->first_index)+(index);
|
||||
buffer_index = viewer.num_tracks-pb->first_index+index;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -240,9 +240,9 @@ static int playlist_buffer_get_index(struct playlist_buffer *pb, int index)
|
|||
buffer_index = pb->first_index-index;
|
||||
else /* rotation : track0 in buffer + dist from the last track
|
||||
to the requested track (num_tracks-requested track) */
|
||||
buffer_index=(pb->first_index)+(viewer.num_tracks-index);
|
||||
buffer_index = pb->first_index+viewer.num_tracks-index;
|
||||
}
|
||||
return(buffer_index);
|
||||
return buffer_index;
|
||||
}
|
||||
|
||||
#define distance(a, b) \
|
||||
|
|
@ -251,23 +251,23 @@ static bool playlist_buffer_needs_reload(struct playlist_buffer* pb,
|
|||
int track_index)
|
||||
{
|
||||
if (pb->num_loaded == viewer.num_tracks)
|
||||
return(false);
|
||||
return false;
|
||||
int selected_index = playlist_buffer_get_index(pb, track_index);
|
||||
int first_buffer_index = playlist_buffer_get_index(pb, pb->first_index);
|
||||
int distance_beginning = distance(selected_index, first_buffer_index);
|
||||
if (distance_beginning < MIN_BUFFER_MARGIN)
|
||||
return(true);
|
||||
return true;
|
||||
|
||||
if (pb->num_loaded - distance_beginning < MIN_BUFFER_MARGIN)
|
||||
return(true);
|
||||
return(false);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer *pb,
|
||||
int index)
|
||||
{
|
||||
int buffer_index = playlist_buffer_get_index(pb, index);
|
||||
return(&(pb->tracks[buffer_index]));
|
||||
return &(pb->tracks[buffer_index]);
|
||||
}
|
||||
|
||||
/* Initialize the playlist viewer. */
|
||||
|
|
@ -833,7 +833,8 @@ bool search_playlist(void)
|
|||
|
||||
cpu_boost(true);
|
||||
|
||||
for (i=0; (i<playlist_count)&&(found_indicies_count<MAX_PLAYLIST_ENTRIES); i++)
|
||||
for (i = 0; i < playlist_count &&
|
||||
found_indicies_count < MAX_PLAYLIST_ENTRIES; i++)
|
||||
{
|
||||
if (found_indicies_count != last_found_count)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue