summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-01-31 19:41:29 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-01-31 19:41:29 +0000
commit91948d12aa76645fefe817931d64145196140430 (patch)
tree5a7c73b30b30f2c3f90ab0f554d3ef2692ee8018 /apps
parent31c8eee99d7917bf83bbc6cf4cb9579af10d4d42 (diff)
downloadrockbox-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
Diffstat (limited to 'apps')
-rw-r--r--apps/cuesheet.c3
-rw-r--r--apps/cuesheet.h1
-rw-r--r--apps/gui/gwps-common.c22
-rw-r--r--apps/playback.c17
4 files changed, 7 insertions, 36 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
47struct cuesheet *curr_cue; 47struct cuesheet *curr_cue;
48struct 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
55extern struct cuesheet *curr_cue; 55extern struct cuesheet *curr_cue;
56extern struct cuesheet *temp_cue;
57 56
58/* returns true if cuesheet support is initialised */ 57/* returns true if cuesheet support is initialised */
59bool cuesheet_is_enabled(void); 58bool 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) {