fix FS#10453 - the cuesheet changes broke playback on swcodec, rework it so it uses the audio buffer instead of a temp buffer from the start (which also removes one pretty big memcpy)

also remove the audio_filename from the cuesheet struct as its useless


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21982 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2009-07-20 15:50:26 +00:00
parent a7548d3bc7
commit c46669a230
3 changed files with 14 additions and 9 deletions

View file

@ -39,7 +39,6 @@ struct cue_track_info {
struct cuesheet { struct cuesheet {
char path[MAX_PATH]; char path[MAX_PATH];
char audio_filename[MAX_PATH];
char title[MAX_NAME*3+1]; char title[MAX_NAME*3+1];
char performer[MAX_NAME*3+1]; char performer[MAX_NAME*3+1];

View file

@ -2057,7 +2057,6 @@ struct mp3entry* audio_current_track()
if (look_for_cuesheet_file(id3->path, cuepath) && if (look_for_cuesheet_file(id3->path, cuepath) &&
parse_cuesheet(cuepath, curr_cuesheet)) parse_cuesheet(cuepath, curr_cuesheet))
{ {
strcpy(curr_cuesheet->audio_filename, id3->path);
id3->cuesheet = curr_cuesheet; id3->cuesheet = curr_cuesheet;
cue_spoof_id3(curr_cuesheet, id3); cue_spoof_id3(curr_cuesheet, id3);
} }

View file

@ -1853,15 +1853,22 @@ static void audio_finish_load_track(void)
if (curr_cue) if (curr_cue)
{ {
char cuepath[MAX_PATH]; char cuepath[MAX_PATH];
if (look_for_cuesheet_file(track_id3->path, cuepath))
struct cuesheet temp_cue;
if (look_for_cuesheet_file(track_id3->path, cuepath) &&
parse_cuesheet(cuepath, &temp_cue))
{ {
strcpy(temp_cue.audio_filename, track_id3->path); void *temp;
tracks[track_widx].cuesheet_hid = tracks[track_widx].cuesheet_hid =
bufalloc(&temp_cue, sizeof(struct cuesheet), TYPE_CUESHEET); bufalloc(NULL, sizeof(struct cuesheet), TYPE_CUESHEET);
if (tracks[track_widx].cuesheet_hid >= 0)
{
bufgetdata(tracks[track_widx].cuesheet_hid,
sizeof(struct cuesheet), &temp);
struct cuesheet *cuesheet = (struct cuesheet*)temp;
if (!parse_cuesheet(cuepath, cuesheet))
{
bufclose(tracks[track_widx].cuesheet_hid);
track_id3->cuesheet = NULL;
}
}
} }
} }
#ifdef HAVE_ALBUMART #ifdef HAVE_ALBUMART