From 5f25e0d4e2f8e0cfa24da438eefccdcc15c347f6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 16 May 2020 15:59:10 -0700 Subject: [PATCH] Add limited support for frame pacing to EGLRenderer --- app/streaming/video/ffmpeg-renderers/eglvid.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/eglvid.cpp b/app/streaming/video/ffmpeg-renderers/eglvid.cpp index c2af3ed4..a02ab582 100644 --- a/app/streaming/video/ffmpeg-renderers/eglvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/eglvid.cpp @@ -401,8 +401,10 @@ bool EGLRenderer::initialize(PDECODER_PARAMETERS params) glClear(GL_COLOR_BUFFER_BIT); if (params->enableVsync) { - /* Try to use adaptive VSYNC */ - if (SDL_GL_SetSwapInterval(-1)) + // Try to use adaptive VSYNC unless we're using frame pacing. + // Frame pacing relies on us blocking in renderFrame() to + // match the display refresh rate. + if (params->enableFramePacing || SDL_GL_SetSwapInterval(-1)) SDL_GL_SetSwapInterval(1); } else { SDL_GL_SetSwapInterval(0);