From 91948d12aa76645fefe817931d64145196140430 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 31 Jan 2009 19:41:29 +0000 Subject: FS#9638 - temp_cue is unused and wasting memory. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19890 a1c6a512-1295-4272-9138-f99709370657 --- apps/cuesheet.c | 3 --- apps/cuesheet.h | 1 - apps/gui/gwps-common.c | 22 +++++++--------------- apps/playback.c | 17 ----------------- utils/wpseditor/libwps/src/dummies.c | 1 - utils/wpseditor/libwps/src/dummies.h | 1 - 6 files changed, 7 insertions(+), 38 deletions(-) diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 4b3f5e9bc4..0a7521bbc5 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -45,7 +45,6 @@ #define CUE_DIR ROCKBOX_DIR "/cue" struct cuesheet *curr_cue; -struct cuesheet *temp_cue; #if CONFIG_CODEC != SWCODEC /* special trickery because the hwcodec playback engine is in firmware/ */ @@ -59,13 +58,11 @@ void cuesheet_init(void) { if (global_settings.cuesheet) { curr_cue = (struct cuesheet *)buffer_alloc(sizeof(struct cuesheet)); - temp_cue = (struct cuesheet *)buffer_alloc(sizeof(struct cuesheet)); #if CONFIG_CODEC != SWCODEC audio_set_cuesheet_callback(cuesheet_handler); #endif } else { curr_cue = NULL; - temp_cue = NULL; } } diff --git a/apps/cuesheet.h b/apps/cuesheet.h index de51512195..41ee9be397 100644 --- a/apps/cuesheet.h +++ b/apps/cuesheet.h @@ -53,7 +53,6 @@ struct cuesheet { }; extern struct cuesheet *curr_cue; -extern struct cuesheet *temp_cue; /* returns true if cuesheet support is initialised */ bool cuesheet_is_enabled(void); diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 5a672ba2a7..e07436e565 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -437,23 +437,15 @@ bool update(struct gui_wps *gwps) && strcmp(gwps->state->id3->path, curr_cue->audio_filename)) { /* the current cuesheet isn't the right one any more */ + /* We need to parse the new cuesheet */ - if (!strcmp(gwps->state->id3->path, temp_cue->audio_filename)) { - /* We have the new cuesheet in memory (temp_cue), - let's make it the current one ! */ - memcpy(curr_cue, temp_cue, sizeof(struct cuesheet)); - } - else { - /* We need to parse the new cuesheet */ - - char cuepath[MAX_PATH]; + char cuepath[MAX_PATH]; - if (look_for_cuesheet_file(gwps->state->id3->path, cuepath) && - parse_cuesheet(cuepath, curr_cue)) - { - gwps->state->id3->cuesheet_type = 1; - strcpy(curr_cue->audio_filename, gwps->state->id3->path); - } + if (look_for_cuesheet_file(gwps->state->id3->path, cuepath) && + parse_cuesheet(cuepath, curr_cue)) + { + gwps->state->id3->cuesheet_type = 1; + strcpy(curr_cue->audio_filename, gwps->state->id3->path); } cue_spoof_id3(curr_cue, gwps->state->id3); diff --git a/apps/playback.c b/apps/playback.c index 8a15b9dc8d..55c1878d4e 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1768,23 +1768,6 @@ static void audio_finish_load_track(void) size_t offset = 0; bool start_play = start_play_g; -#if 0 - if (cuesheet_is_enabled() && tracks[track_widx].id3.cuesheet_type == 1) - { - char cuepath[MAX_PATH]; - - struct cuesheet *cue = start_play ? curr_cue : temp_cue; - - if (look_for_cuesheet_file(trackname, cuepath) && - parse_cuesheet(cuepath, cue)) - { - strcpy((cue)->audio_filename, trackname); - if (start_play) - cue_spoof_id3(curr_cue, &tracks[track_widx].id3); - } - } -#endif - track_load_started = false; if (tracks[track_widx].id3_hid < 0) { diff --git a/utils/wpseditor/libwps/src/dummies.c b/utils/wpseditor/libwps/src/dummies.c index e70bc3c28f..96c30ee1b3 100644 --- a/utils/wpseditor/libwps/src/dummies.c +++ b/utils/wpseditor/libwps/src/dummies.c @@ -30,7 +30,6 @@ struct wps_state wps_state; struct gui_wps gui_wps[NB_SCREENS]; struct wps_data wps_datas[NB_SCREENS]; struct cuesheet *curr_cue; -struct cuesheet *temp_cue; struct system_status global_status; struct gui_syncstatusbar statusbars; struct playlist_info current_playlist; diff --git a/utils/wpseditor/libwps/src/dummies.h b/utils/wpseditor/libwps/src/dummies.h index 758a8636fa..15ee29cca1 100644 --- a/utils/wpseditor/libwps/src/dummies.h +++ b/utils/wpseditor/libwps/src/dummies.h @@ -40,7 +40,6 @@ extern struct wps_state wps_state; extern struct gui_wps gui_wps[NB_SCREENS]; extern struct wps_data wps_datas[NB_SCREENS]; extern struct cuesheet *curr_cue; -extern struct cuesheet *temp_cue; extern struct system_status global_status; extern struct gui_syncstatusbar statusbars; extern struct playlist_info current_playlist; -- cgit v1.2.3