]> git.sesse.net Git - nageru/blobdiff - futatabi/player.h
Fix some Futatabi shutdown problems.
[nageru] / futatabi / player.h
index c7f8e070a71a0ce697e1c21edd14727a3892762f..b57bada647f2cb48439265cf8e534a6179c4d8f3 100644 (file)
@@ -12,6 +12,7 @@ extern "C" {
 #include <condition_variable>
 #include <functional>
 #include <mutex>
+#include <thread>
 
 class JPEGFrameView;
 class VideoStream;
@@ -21,6 +22,7 @@ class QSurfaceFormat;
 class Player : public QueueInterface {
 public:
        Player(JPEGFrameView *destination, bool also_output_to_stream);
+       ~Player();
 
        void play_clip(const Clip &clip, size_t clip_idx, unsigned stream_idx);
        void override_angle(unsigned stream_idx);  // For the current clip only.
@@ -55,6 +57,9 @@ private:
        // Returns false if pts is after the last frame.
        bool find_surrounding_frames(int64_t pts, int stream_idx, FrameOnDisk *frame_lower, FrameOnDisk *frame_upper);
 
+       std::thread player_thread;
+       std::atomic<bool> should_quit{false};
+
        JPEGFrameView *destination;
        done_callback_func done_callback;
        next_clip_callback_func next_clip_callback;