Re: Re: USB DVD Device Support
Home › Forums › Development › USB DVD Device Support › Re: Re: USB DVD Device Support
February 14, 2011 at 6:06 pm
#28334
aka107
Member
@clava wrote:
Seems that the only way to detect if the dvd is inserted is calling to USBStorage_ReadCapacity
So if you use my old USBStorage_IsDVD then it will return 0 if dvd is not insertedWhat about adding something like this:
if(__mounted) {
u32 sectorsize, numSectors;
if (USBStorage_ReadCapacity(&__usbfd, __lun, §orsize, &numSectors) < 0)
return false;
else
return true;
}
at the beginning of __usbstorage_IsInserted()? It works in wiimc 😀
uhmm, I think we can add another condition to check only if the usb device is a dvd, only for security
if(__mounted && __usbfd.sector_size[__lun]==2048) { //mounted and a dvd
u32 sectorsize, numSectors;
if (USBStorage_ReadCapacity(&__usbfd, __lun, §orsize, &numSectors) < 0)
return false;
else
return true;
}
Can you test it using a ios different from ios58?
I want to be sure that works with usb1 and not only with usb2
__mounted is handled in a different way in usb1
Also Tantric has to commit 2 fixes in usbstorage.c I guess he will do it very soon
