Use a separate callback to indicate EOS instead of renderFrame()

This commit is contained in:
Cameron Gutman
2022-04-07 21:30:20 -05:00
parent 5de0dc2713
commit 474591c6a5
12 changed files with 18 additions and 50 deletions
@@ -46,8 +46,9 @@ Pacer::~Pacer()
SDL_WaitThread(m_RenderThread, nullptr);
}
else {
// Send a null AVFrame to indicate end of stream on the main thread
m_VsyncRenderer->renderFrame(nullptr);
// Notify the renderer that it is being destroyed soon
// NB: This must happen on the same thread that calls renderFrame().
m_VsyncRenderer->cleanupRenderContext();
}
// Delete any remaining unconsumed frames
@@ -110,8 +111,9 @@ int Pacer::renderThread(void* context)
me->renderLastFrameAndUnlock();
}
// Send a null AVFrame to indicate end of stream on the render thread
me->m_VsyncRenderer->renderFrame(nullptr);
// Notify the renderer that it is being destroyed soon
// NB: This must happen on the same thread that calls renderFrame().
me->m_VsyncRenderer->cleanupRenderContext();
return 0;
}