return -1;
}
- track->type = CT_AUDIO;
+ track->type = CT_MP3;
track->fd = tmp_file;
track->offset = 0;
if (PicoCDLoadProgressCB != NULL)
PicoCDLoadProgressCB(cd_img_name, 1);
- Pico_mcd->cdda_type = CT_UNKNOWN;
-
/* is this a .cue? */
cue_data = cue_parse(cd_img_name);
if (cue_data != NULL) {
}
tracks[0].fd = pmf;
tracks[0].fname = strdup(cd_img_name);
- tracks[0].type = *type & CT_AUDIO;
+ tracks[0].type = *type;
if (*type == CT_ISO)
cd_img_sectors = pmf->size >> 11; // size in sectors
// overriden by custom cue command
length = cue_data->tracks[n].sector_xlength;
- Pico_mcd->cdda_type = cue_data->tracks[n].type;
- tracks[index].type = cue_data->tracks[n].type & CT_AUDIO;
+ tracks[index].type = cue_data->tracks[n].type;
tracks[index].start = lba;
lba += length;
lba += length;
tracks[index].end = lba;
- Pico_mcd->cdda_type = CT_MP3;
- tracks[index].type = CT_AUDIO;
+ tracks[index].type = CT_MP3;
sprintf_lba(tmp_ext, sizeof(tmp_ext), tracks[index].start);
elprintf(EL_STATUS, "Track %2i: %s %9i AUDIO - %s",
for (i = index; i >= 0; i--)
if (cdd.toc.tracks[i].fd != NULL)
break;
+ // TODO: this doesn't cover all tracks being in a single bin file properly:
+ // in that case, fd should be duplicated to work properly with this MD+ shit.
if (! is_audio(i)) return;
Pico_mcd->cdda_stream = cdd.toc.tracks[i].fd;
+ Pico_mcd->cdda_type = cdd.toc.tracks[i].type;
base = cdd.toc.tracks[index].offset;
lba_offset = lba - cdd.toc.tracks[index].start;
lb_len = cdd.toc.tracks[index].end - cdd.toc.tracks[index].start;
int i;
/* stop audio streaming */
- Pico_mcd->cdda_stream = NULL;
+ if (Pico_mcd) Pico_mcd->cdda_stream = NULL;
/* close CD tracks */
if (cdd.toc.tracks[0].fd)
if (cdd.toc.tracks[i].fd)
{
/* close file */
- if (Pico_mcd->cdda_type == CT_MP3)
+ if (cdd.toc.tracks[i].type == CT_MP3)
fclose(cdd.toc.tracks[i].fd);
else
pm_close(cdd.toc.tracks[i].fd);