mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
cdrom: C89 fix, timeout calculation fix
This commit is contained in:
parent
28c40ffab6
commit
534b9125a9
@ -1097,7 +1097,7 @@ int cdrom_read(libretro_vfs_implementation_file *stream, cdrom_group_timeouts_t
|
|||||||
double frames = (len + skip) / 2352.0;
|
double frames = (len + skip) / 2352.0;
|
||||||
unsigned frame_end = cdrom_msf_to_lba(min, sec, frame) + ceil(frames);
|
unsigned frame_end = cdrom_msf_to_lba(min, sec, frame) + ceil(frames);
|
||||||
|
|
||||||
if (timeouts->g1_timeout && frames > timeouts->g1_timeout)
|
if (timeouts->g1_timeout && (frames / 75) > timeouts->g1_timeout)
|
||||||
{
|
{
|
||||||
printf("[CDROM] multi-frame read of %d seconds is longer than group 1 timeout of %d seconds\n", (int)frames, timeouts->g1_timeout);
|
printf("[CDROM] multi-frame read of %d seconds is longer than group 1 timeout of %d seconds\n", (int)frames, timeouts->g1_timeout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@ -69,11 +69,12 @@ bool media_detect_cd_info(const char *path, media_detect_cd_info_t *info)
|
|||||||
unsigned sector_size = 0;
|
unsigned sector_size = 0;
|
||||||
unsigned buf_size = 17 * 2352;
|
unsigned buf_size = 17 * 2352;
|
||||||
char *buf = (char*)calloc(1, buf_size);
|
char *buf = (char*)calloc(1, buf_size);
|
||||||
|
int64_t read_bytes = 0;
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int64_t read_bytes = filestream_read(file, buf, buf_size);
|
read_bytes = filestream_read(file, buf, buf_size);
|
||||||
|
|
||||||
if (read_bytes != buf_size)
|
if (read_bytes != buf_size)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user