forked from len0rd/rockbox
Fix one cause of buffer-offness, but I'm pretty sure this is not the cause of problems that people are having as the debug code I put in detects and corrects it. Make taginfo instead of stupid filename appear on manual track skip, off buffer (stupid bug).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9658 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
74ccea9fb1
commit
fbe74d1df6
1 changed files with 8 additions and 3 deletions
|
|
@ -645,14 +645,16 @@ size_t buffer_count_tracks(int from_track, int to_track) {
|
||||||
|
|
||||||
from_track++;
|
from_track++;
|
||||||
|
|
||||||
while (from_track < to_track || need_wrap)
|
while (1)
|
||||||
{
|
{
|
||||||
amount += tracks[from_track].codecsize + tracks[from_track].filesize;
|
|
||||||
if (++from_track >= MAX_TRACK)
|
if (++from_track >= MAX_TRACK)
|
||||||
{
|
{
|
||||||
from_track -= MAX_TRACK;
|
from_track -= MAX_TRACK;
|
||||||
need_wrap = false;
|
need_wrap = false;
|
||||||
}
|
}
|
||||||
|
if (from_track < to_track || need_wrap)
|
||||||
|
break;
|
||||||
|
amount += tracks[from_track].codecsize + tracks[from_track].filesize;
|
||||||
}
|
}
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
@ -818,7 +820,10 @@ static void audio_check_new_track(bool require_codec)
|
||||||
|
|
||||||
/* If it is not safe to even skip this many track entries */
|
/* If it is not safe to even skip this many track entries */
|
||||||
if (new_track >= track_count || new_track <= track_count - MAX_TRACK)
|
if (new_track >= track_count || new_track <= track_count - MAX_TRACK)
|
||||||
|
{
|
||||||
|
cur_ti->taginfo_ready = false;
|
||||||
audio_rebuffer();
|
audio_rebuffer();
|
||||||
|
}
|
||||||
/* If the target track is clearly not in memory */
|
/* If the target track is clearly not in memory */
|
||||||
else if (cur_ti->filesize == 0 || !cur_ti->taginfo_ready)
|
else if (cur_ti->filesize == 0 || !cur_ti->taginfo_ready)
|
||||||
audio_rebuffer();
|
audio_rebuffer();
|
||||||
|
|
@ -2190,7 +2195,7 @@ struct mp3entry* audio_current_track(void)
|
||||||
else if (cur_idx < 0)
|
else if (cur_idx < 0)
|
||||||
cur_idx += MAX_TRACK;
|
cur_idx += MAX_TRACK;
|
||||||
|
|
||||||
if (have_tracks() && tracks[cur_idx].taginfo_ready)
|
if (tracks[cur_idx].taginfo_ready)
|
||||||
return &tracks[cur_idx].id3;
|
return &tracks[cur_idx].id3;
|
||||||
|
|
||||||
memset(&temp_id3, 0, sizeof(struct mp3entry));
|
memset(&temp_id3, 0, sizeof(struct mp3entry));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue