mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 07:46:07 +00:00
Use SDL_UpdateNVTexture on SDL 2.0.15+
This commit is contained in:
parent
a0cc93b813
commit
137454beff
@ -291,6 +291,18 @@ void SdlRenderer::renderFrame(AVFrame* frame)
|
||||
frame->linesize[2]);
|
||||
}
|
||||
else {
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 15)
|
||||
// SDL_UpdateNVTexture is not supported on all renderer backends,
|
||||
// (notably not DX9), so we must have a fallback in case it's not
|
||||
// supported and for earlier versions of SDL.
|
||||
if (SDL_UpdateNVTexture(m_Texture,
|
||||
nullptr,
|
||||
frame->data[0],
|
||||
frame->linesize[0],
|
||||
frame->data[1],
|
||||
frame->linesize[1]) != 0)
|
||||
#endif
|
||||
{
|
||||
char* pixels;
|
||||
int pitch;
|
||||
|
||||
@ -311,6 +323,7 @@ void SdlRenderer::renderFrame(AVFrame* frame)
|
||||
|
||||
SDL_UnlockTexture(m_Texture);
|
||||
}
|
||||
}
|
||||
|
||||
SDL_RenderClear(m_Renderer);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user