Skip to content
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

No way to find out whether loading a video failed + memory leak(s) #752

Open
MoritzBrueckner opened this issue Dec 16, 2022 · 0 comments
Open

Comments

@MoritzBrueckner
Copy link

From Kode/Kha#1441:

I didn't implement the failed callback in HL for loading videos because I wasn't sure how to handle things in kinc_video_init() (e.g. video.cpp.h for Windows) which doesn't have a return value at the moment and on Windows simply ignores the HRESULT values returned from the functions it calls. I don't know if you want to slightly change Kinc's API, but I think this is required in order to get error information out of this method. Preferably there would be some more stuff in place that in case of an error would print the actual reason to the console (e.g. the HRESULT value if != S_OK). I think this would have a very minor impact on performance but would be an tremendously helpful change.

To call the failed callback in Kha when loading a video fails, kinc_video_init() needs to be changed in order to return a value that can be used in Kha. It would be even better to print the actual cause of the failure in kinc_video_init() (if there is one). It's probably very easy to implement, but since I can only test the windows backend and don't want to change the Kinc API without an agreement on how it should look like, I'm opening this issue instead.

Also, at least in the Windows backend, there is memory allocated for video->impl.renderer which isn't freed if loading a video fails. The same might happen in other places as well, I don't know the GraphBuilder API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant