]> git.sesse.net Git - nageru/blobdiff - ffmpeg_capture.h
Make some more sleeps interruptable.
[nageru] / ffmpeg_capture.h
index e6b4ed481f6b151e8a687a1f7b0aec5dab7d0472..24e6b5b40d3f9b780e71facdb7fb0dc347e5723c 100644 (file)
@@ -31,6 +31,7 @@
 #include <thread>
 
 #include "bmusb/bmusb.h"
+#include "quittable_sleeper.h"
 
 class FFmpegCapture : public bmusb::CaptureInterface
 {
@@ -157,7 +158,7 @@ private:
        std::unique_ptr<bmusb::FrameAllocator> owned_audio_frame_allocator;
        bmusb::frame_callback_t frame_callback = nullptr;
 
-       std::atomic<bool> producer_thread_should_quit{false};
+       QuittableSleeper producer_thread_should_quit;
        std::thread producer_thread;
 
        std::mutex queue_mu;