mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-18 02:38:27 +00:00
Simplified SDL_SetProperty() and added SDL_SetPropertyWithCleanup()
Most of the time people won't need to set a cleanup callback, so we can simplify the more commonly used API.
This commit is contained in:
parent
a1941fad6c
commit
aea6e6de6f
16 changed files with 61 additions and 34 deletions
|
@ -464,7 +464,7 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture)
|
|||
SDL_OutOfMemory();
|
||||
return SDL_FALSE;
|
||||
}
|
||||
SDL_SetProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL);
|
||||
SDL_SetPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL);
|
||||
}
|
||||
sws_container->context = sws_getCachedContext(sws_container->context, frame->width, frame->height, frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, SWS_POINT, NULL, NULL, NULL);
|
||||
if (sws_container->context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue