Fix a potential race condition with cuesheets (that hit every time in an archos test), plus a slight optimisation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12524 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d70dc25edf
commit
b49602e7a9
1 changed files with 21 additions and 23 deletions
|
@ -2610,30 +2610,28 @@ bool update(struct gui_wps *gwps)
|
|||
sizeof(gwps->state->current_track_path));
|
||||
}
|
||||
|
||||
if (cuesheet_is_enabled() && gwps->state->id3->cuesheet_type
|
||||
&& (gwps->state->id3->elapsed < curr_cue->curr_track->offset
|
||||
|| (curr_cue->curr_track_idx < curr_cue->track_count - 1
|
||||
&& gwps->state->id3->elapsed >= (curr_cue->curr_track+1)->offset)))
|
||||
{
|
||||
/* We've changed tracks within the cuesheet :
|
||||
we need to update the ID3 info and refresh the WPS */
|
||||
|
||||
cue_find_current_track(curr_cue, gwps->state->id3->elapsed);
|
||||
cue_spoof_id3(curr_cue, gwps->state->id3);
|
||||
|
||||
gwps->display->stop_scroll();
|
||||
if (gui_wps_display())
|
||||
retcode = true;
|
||||
else{
|
||||
gui_wps_refresh(gwps, 0, WPS_REFRESH_ALL);
|
||||
}
|
||||
gui_wps_statusbar_draw(gwps, false);
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
if (gwps->state->id3)
|
||||
gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
|
||||
{
|
||||
if (cuesheet_is_enabled() && gwps->state->id3->cuesheet_type
|
||||
&& (gwps->state->id3->elapsed < curr_cue->curr_track->offset
|
||||
|| (curr_cue->curr_track_idx < curr_cue->track_count - 1
|
||||
&& gwps->state->id3->elapsed >= (curr_cue->curr_track+1)->offset)))
|
||||
{
|
||||
/* We've changed tracks within the cuesheet :
|
||||
we need to update the ID3 info and refresh the WPS */
|
||||
|
||||
cue_find_current_track(curr_cue, gwps->state->id3->elapsed);
|
||||
cue_spoof_id3(curr_cue, gwps->state->id3);
|
||||
|
||||
gwps->display->stop_scroll();
|
||||
if (gui_wps_display())
|
||||
retcode = true;
|
||||
else
|
||||
gui_wps_refresh(gwps, 0, WPS_REFRESH_ALL);
|
||||
}
|
||||
else
|
||||
gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
|
||||
}
|
||||
|
||||
gui_wps_statusbar_draw(gwps, false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue