mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-05 05:44:55 +01:00
It's rather unnecessary to use the same ioctls multiple times per disc when the info returned doesn't change. Just use each ioctl once and read/calculate all the necessary info all at onace. This also fixes an issue where the IOCTL_DVD_START_SESSION ioctl is repeatedly used if the returned session ID is 0. The previous code assumed that 0 was not a valid session ID and would repeatedly use the ioctl to obtain a non-zero session ID. However, 0 is a valid session ID, and it seems IOCTL_DVD_START_SESSION can repeatedly return a 0 session ID even if the corresponding IOCTL_DVD_END_SESSION has not been called. In our case, a DVD session is only necessary for DVD detection and reading the physical format information. This fix seems to alter drive speed behaviour.