diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2009-01-31 19:41:29 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2009-01-31 19:41:29 +0000 |
commit | 91948d12aa76645fefe817931d64145196140430 (patch) | |
tree | 5a7c73b30b30f2c3f90ab0f554d3ef2692ee8018 | |
parent | 31c8eee99d7917bf83bbc6cf4cb9579af10d4d42 (diff) | |
download | rockbox-91948d12aa76645fefe817931d64145196140430.tar.gz rockbox-91948d12aa76645fefe817931d64145196140430.zip |
FS#9638 - temp_cue is unused and wasting memory.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19890 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/cuesheet.c | 3 | ||||
-rw-r--r-- | apps/cuesheet.h | 1 | ||||
-rw-r--r-- | apps/gui/gwps-common.c | 22 | ||||
-rw-r--r-- | apps/playback.c | 17 | ||||
-rw-r--r-- | utils/wpseditor/libwps/src/dummies.c | 1 | ||||
-rw-r--r-- | 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 @@ | |||
45 | #define CUE_DIR ROCKBOX_DIR "/cue" | 45 | #define CUE_DIR ROCKBOX_DIR "/cue" |
46 | 46 | ||
47 | struct cuesheet *curr_cue; | 47 | struct cuesheet *curr_cue; |
48 | struct cuesheet *temp_cue; | ||
49 | 48 | ||
50 | #if CONFIG_CODEC != SWCODEC | 49 | #if CONFIG_CODEC != SWCODEC |
51 | /* special trickery because the hwcodec playback engine is in firmware/ */ | 50 | /* special trickery because the hwcodec playback engine is in firmware/ */ |
@@ -59,13 +58,11 @@ void cuesheet_init(void) | |||
59 | { | 58 | { |
60 | if (global_settings.cuesheet) { | 59 | if (global_settings.cuesheet) { |
61 | curr_cue = (struct cuesheet *)buffer_alloc(sizeof(struct cuesheet)); | 60 | curr_cue = (struct cuesheet *)buffer_alloc(sizeof(struct cuesheet)); |
62 | temp_cue = (struct cuesheet *)buffer_alloc(sizeof(struct cuesheet)); | ||
63 | #if CONFIG_CODEC != SWCODEC | 61 | #if CONFIG_CODEC != SWCODEC |
64 | audio_set_cuesheet_callback(cuesheet_handler); | 62 | audio_set_cuesheet_callback(cuesheet_handler); |
65 | #endif | 63 | #endif |
66 | } else { | 64 | } else { |
67 | curr_cue = NULL; | 65 | curr_cue = NULL; |
68 | temp_cue = NULL; | ||
69 | } | 66 | } |
70 | } | 67 | } |
71 | 68 | ||
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 { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | extern struct cuesheet *curr_cue; | 55 | extern struct cuesheet *curr_cue; |
56 | extern struct cuesheet *temp_cue; | ||
57 | 56 | ||
58 | /* returns true if cuesheet support is initialised */ | 57 | /* returns true if cuesheet support is initialised */ |
59 | bool cuesheet_is_enabled(void); | 58 | 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) | |||
437 | && strcmp(gwps->state->id3->path, curr_cue->audio_filename)) | 437 | && strcmp(gwps->state->id3->path, curr_cue->audio_filename)) |
438 | { | 438 | { |
439 | /* the current cuesheet isn't the right one any more */ | 439 | /* the current cuesheet isn't the right one any more */ |
440 | /* We need to parse the new cuesheet */ | ||
440 | 441 | ||
441 | if (!strcmp(gwps->state->id3->path, temp_cue->audio_filename)) { | 442 | char cuepath[MAX_PATH]; |
442 | /* We have the new cuesheet in memory (temp_cue), | ||
443 | let's make it the current one ! */ | ||
444 | memcpy(curr_cue, temp_cue, sizeof(struct cuesheet)); | ||
445 | } | ||
446 | else { | ||
447 | /* We need to parse the new cuesheet */ | ||
448 | |||
449 | char cuepath[MAX_PATH]; | ||
450 | 443 | ||
451 | if (look_for_cuesheet_file(gwps->state->id3->path, cuepath) && | 444 | if (look_for_cuesheet_file(gwps->state->id3->path, cuepath) && |
452 | parse_cuesheet(cuepath, curr_cue)) | 445 | parse_cuesheet(cuepath, curr_cue)) |
453 | { | 446 | { |
454 | gwps->state->id3->cuesheet_type = 1; | 447 | gwps->state->id3->cuesheet_type = 1; |
455 | strcpy(curr_cue->audio_filename, gwps->state->id3->path); | 448 | strcpy(curr_cue->audio_filename, gwps->state->id3->path); |
456 | } | ||
457 | } | 449 | } |
458 | 450 | ||
459 | cue_spoof_id3(curr_cue, gwps->state->id3); | 451 | 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) | |||
1768 | size_t offset = 0; | 1768 | size_t offset = 0; |
1769 | bool start_play = start_play_g; | 1769 | bool start_play = start_play_g; |
1770 | 1770 | ||
1771 | #if 0 | ||
1772 | if (cuesheet_is_enabled() && tracks[track_widx].id3.cuesheet_type == 1) | ||
1773 | { | ||
1774 | char cuepath[MAX_PATH]; | ||
1775 | |||
1776 | struct cuesheet *cue = start_play ? curr_cue : temp_cue; | ||
1777 | |||
1778 | if (look_for_cuesheet_file(trackname, cuepath) && | ||
1779 | parse_cuesheet(cuepath, cue)) | ||
1780 | { | ||
1781 | strcpy((cue)->audio_filename, trackname); | ||
1782 | if (start_play) | ||
1783 | cue_spoof_id3(curr_cue, &tracks[track_widx].id3); | ||
1784 | } | ||
1785 | } | ||
1786 | #endif | ||
1787 | |||
1788 | track_load_started = false; | 1771 | track_load_started = false; |
1789 | 1772 | ||
1790 | if (tracks[track_widx].id3_hid < 0) { | 1773 | 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; | |||
30 | struct gui_wps gui_wps[NB_SCREENS]; | 30 | struct gui_wps gui_wps[NB_SCREENS]; |
31 | struct wps_data wps_datas[NB_SCREENS]; | 31 | struct wps_data wps_datas[NB_SCREENS]; |
32 | struct cuesheet *curr_cue; | 32 | struct cuesheet *curr_cue; |
33 | struct cuesheet *temp_cue; | ||
34 | struct system_status global_status; | 33 | struct system_status global_status; |
35 | struct gui_syncstatusbar statusbars; | 34 | struct gui_syncstatusbar statusbars; |
36 | struct playlist_info current_playlist; | 35 | 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; | |||
40 | extern struct gui_wps gui_wps[NB_SCREENS]; | 40 | extern struct gui_wps gui_wps[NB_SCREENS]; |
41 | extern struct wps_data wps_datas[NB_SCREENS]; | 41 | extern struct wps_data wps_datas[NB_SCREENS]; |
42 | extern struct cuesheet *curr_cue; | 42 | extern struct cuesheet *curr_cue; |
43 | extern struct cuesheet *temp_cue; | ||
44 | extern struct system_status global_status; | 43 | extern struct system_status global_status; |
45 | extern struct gui_syncstatusbar statusbars; | 44 | extern struct gui_syncstatusbar statusbars; |
46 | extern struct playlist_info current_playlist; | 45 | extern struct playlist_info current_playlist; |