mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-27 02:42:26 -04:00
Since video rendering happens on a separate thread from PipeWire buffer ingestion, it may happen that two buffers are ingested in quick succession without the rendering thread ever getting to them. Since, prior to this commit, the release sync point is only "primed" (set to signal in the future) only on the video rendering thread, this results in the buffer being returned to PipeWire's pool without anything ever signaling the release point, effectively blocking it from ever getting reused in the future. This quickly clogs up the buffer pool and leaves only one buffer to circulate between the screencast source and OBS. This commit adds a flag tracking whether the release point had been primed. If, when ingesting a new PW buffer, the old buffer's release point hadn't been primed, that means the video rendering thread never got to that buffer, so the release point is immediately signaled, marking the buffer reusable by the screencast source.