-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file_stream_transform not working properly (again) #105
Comments
@albertofustinoni I noticed that these functions don't handle the special pointers for stdin/stdout/stderr and hence cause weird memory errors with simple things like |
I found the culprit for the fbneo cdda playback : filestream_read is returning the number of byte read while fread returns the number of element read (aka block of size determined by second arg). Fixing rfread is pretty straight forward (142132e), but to leverage migration from standard file functions to filestream (without using the transform stuff, which is causing other issues thanks to the lack of stdin/stdout/stderr implementation), maybe we should change
|
I have not seen the element parameter used much in general, have you? Either way, adding it to the existing function would require changing not only RA but all 200 cores and their usage of filestream. If you really think it's necessary (I don't, as we haven't needed it so far), I would suggest making a second function with a different name that supports this. Also, I believe internally the element reading is actually done in a loop instead of multiplying the read size by the element count... this behavior can technically work differently depending on the medium, for example with CD-ROM you cannot simply read an arbitrarily high number of bytes at once, but a loop with smaller chunks would work. @twinaphex Thoughts? |
In libretro/fbalpha@df22096 i had to disable file_stream_transform for
src/burner/libretro/retro_cdemu.cpp
, that's the file for neocd iso operation, it uses fopen/fseek/fclose/fread/ftell/fgets, i couldn't determine which one but one of those drop-in replacement from file_stream_transform is not working as it should because if i enable this stuff, cdda playback is totally messed up.Steps to reproduce :
The text was updated successfully, but these errors were encountered: