diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index d11aed41..c0cd24b7 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1653,6 +1653,12 @@ void Session::execInternal() case SDL_RENDER_DEVICE_RESET: case SDL_RENDER_TARGETS_RESET: + if (event.type != SDL_WINDOWEVENT) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "Recreating renderer by internal request: %d", + event.type); + } + SDL_AtomicLock(&m_DecoderLock); // Destroy the old decoder diff --git a/app/streaming/video/ffmpeg-renderers/eglvid.cpp b/app/streaming/video/ffmpeg-renderers/eglvid.cpp index ff355080..464f0da0 100644 --- a/app/streaming/video/ffmpeg-renderers/eglvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/eglvid.cpp @@ -893,6 +893,18 @@ void EGLRenderer::renderFrame(AVFrame* frame) if (!specialize()) { m_EGLImagePixelFormat = AV_PIX_FMT_NONE; + + // Failure to specialize is fatal. We must reset the renderer + // to recover successfully. + // + // Note: This seems to be easy to trigger when transitioning from + // maximized mode by dragging the window down on GNOME 42 using + // XWayland. Other strategies like calling glGetError() don't seem + // to be able to detect this situation for some reason. + SDL_Event event; + event.type = SDL_RENDER_TARGETS_RESET; + SDL_PushEvent(&event); + return; } }