The CD-ROM image code function to check if a track is audio now simply returns with a false condition if the track number obtained from the sector is -1.
This commit is contained in:
@@ -140,7 +140,7 @@ image_is_track_audio(cdrom_t *dev, uint32_t pos, int ismsf)
|
|||||||
uint8_t attr;
|
uint8_t attr;
|
||||||
TMSF tmsf;
|
TMSF tmsf;
|
||||||
int m, s, f;
|
int m, s, f;
|
||||||
int number;
|
int number, track;
|
||||||
|
|
||||||
if (!img || (dev->cd_status == CD_STATUS_DATA_ONLY))
|
if (!img || (dev->cd_status == CD_STATUS_DATA_ONLY))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -153,9 +153,13 @@ image_is_track_audio(cdrom_t *dev, uint32_t pos, int ismsf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* GetTrack requires LBA. */
|
/* GetTrack requires LBA. */
|
||||||
|
track = cdi_get_track(img, pos);
|
||||||
|
if (track == -1)
|
||||||
|
return 0;
|
||||||
|
else {
|
||||||
cdi_get_audio_track_info(img, 0, cdi_get_track(img, pos), &number, &tmsf, &attr);
|
cdi_get_audio_track_info(img, 0, cdi_get_track(img, pos), &number, &tmsf, &attr);
|
||||||
|
|
||||||
return attr == AUDIO_TRACK;
|
return attr == AUDIO_TRACK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user