diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-02-28 23:43:38 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-02-28 23:43:38 +0000 |
commit | b49602e7a9e9ecf811d793be612aceba570a6f51 (patch) | |
tree | 55ca83ae713f3819cadc84c8c2c7193f80d983b8 /apps/gui | |
parent | d70dc25edf4a78eb05ccc320a3c5c1530013100e (diff) |
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
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps-common.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 8fa80c725a..f5e3bc2489 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -2610,31 +2610,29 @@ 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))) + if (gwps->state->id3) { - /* We've changed tracks within the cuesheet : - we need to update the ID3 info and refresh the WPS */ + 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); + 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); + 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; + else + gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); } - if (gwps->state->id3) - gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); - gui_wps_statusbar_draw(gwps, false); return retcode; |