]> git.sesse.net Git - nageru/blobdiff - futatabi/player.cpp
Only enable the queue button if we can actually queue something.
[nageru] / futatabi / player.cpp
index 34beda78f98667d95059a65b8028b141887f8c34..12b1616978c3c002140ead42f2660c34a5f8019e 100644 (file)
@@ -143,7 +143,7 @@ void Player::play_playlist_once()
        if (!clip_ready) {
                if (video_stream != nullptr) {
                        ++metric_refresh_frame;
-                       string subtitle = "Futatabi " NAGERU_VERSION ";PAUSED;" + pause_status;
+                       string subtitle = "Futatabi " NAGERU_VERSION ";PAUSED;0.000;" + pause_status;
                        video_stream->schedule_refresh_frame(steady_clock::now(), pts, /*display_func=*/nullptr, QueueSpotHolder(),
                                subtitle);
                }
@@ -506,11 +506,12 @@ Player::Player(JPEGFrameView *destination, Player::StreamOutput stream_output, A
 Player::~Player()
 {
        should_quit = true;
+       new_clip_changed.notify_all();
+       player_thread.join();
+
        if (video_stream != nullptr) {
                video_stream->stop();
        }
-       new_clip_changed.notify_all();
-       player_thread.join();
 }
 
 void Player::play(const vector<ClipWithID> &clips)
@@ -525,7 +526,7 @@ void Player::play(const vector<ClipWithID> &clips)
 
 void Player::splice_play(const vector<ClipWithID> &clips)
 {
-        lock_guard<mutex> lock(queue_state_mu);
+       lock_guard<mutex> lock(queue_state_mu);
        if (new_clip_ready) {
                queued_clip_list = clips;
                assert(!splice_ready);
@@ -588,7 +589,7 @@ void Player::release_queue_spot()
        new_clip_changed.notify_all();
 }
 
-double compute_time_left(const vector<ClipWithID> &clips, size_t currently_playing_idx, double progress_currently_playing) 
+double compute_time_left(const vector<ClipWithID> &clips, size_t currently_playing_idx, double progress_currently_playing)
 {
        // Look at the last clip and then start counting from there.
        double remaining = 0.0;