Also, current snes9xgit master might cause another assertion error, when opening a movie from movie open dialog, if it's not my fault. (I guess it's because both fd and stream points the same file description. I don't know how it should be fixed.)
gocha wrote:Also, current snes9xgit master might cause another assertion error, when opening a movie from movie open dialog, if it's not my fault. (I guess it's because both fd and stream points the same file description. I don't know how it should be fixed.)
This is visual studio being too pedantic. It's perfectly OK to have two different references to the same file descriptor.
It's not only an assertion, it's a crash on every movie playback. I think the problem was caused during the dup and access call removal. Removing the fclose call after CLOSE_STREAM in S9xMovieOpen stops the crash. IIRC closing a stream also closes the associated file descriptor - that might be the problem here.
Doh. In spec, double-closing a file descriptor definitely shouldn't crash. We also can't leave the FILE type stream there because it's a leak.
Ok, so the problem here is that we need an integer file number to pass to REOPEN_STREAM. We can't just OPEN_STREAM because, when using zlib, seeking is proportional to the compressed size, and the header is uncompressed. We can't use "dup" because it's not standard C, and we can't use "open" because it's also not standard C. And ideas?
Ok, a little research shows that the FILE objects might be managed by the C library, so fclose won't leave it intact. I've checked it in valgrind, any no leak comes from there, so it should be fine.
BearOso wrote:Ok, a little research shows that the FILE objects might be managed by the C library, so fclose won't leave it intact. I've checked it in valgrind, any no leak comes from there, so it should be fine.
Snes9x FAQs | Forum Rules
What operating system are you using? 32 or 64bit? Version of Snes9x? Is the text at the bottom of the window white when you load the game?
These suggestions are usually the solution to your issue!