| 978 | } |
| 979 | |
| 980 | void GSCapture::StopEncoderThread(std::unique_lock<std::mutex>& lock) |
| 981 | { |
| 982 | // Thread will exit when s_capturing is false. |
| 983 | pxAssert(!s_capturing.load(std::memory_order_acquire)); |
| 984 | |
| 985 | if (s_encoder_thread.Joinable()) |
| 986 | { |
| 987 | Console.WriteLn("GSCapture: Stopping encoder thread."); |
| 988 | |
| 989 | // Might be sleeping, so wake it before joining. |
| 990 | s_frame_ready_cv.notify_one(); |
| 991 | lock.unlock(); |
| 992 | s_encoder_thread.Join(); |
| 993 | lock.lock(); |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | bool GSCapture::SendFrame(const PendingFrame& pf) |
| 998 | { |