X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fplayer.cpp;h=6a8612f86e43be0f0f2e1740edd31a0c53ec61d9;hb=8e88294902b4b6f43c8db83dbf04830b5b9d2bfd;hp=34beda78f98667d95059a65b8028b141887f8c34;hpb=e20bf0f86703779f11d575f44173ff73544e1c2d;p=nageru diff --git a/futatabi/player.cpp b/futatabi/player.cpp index 34beda7..6a8612f 100644 --- a/futatabi/player.cpp +++ b/futatabi/player.cpp @@ -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); } @@ -194,7 +194,6 @@ void Player::play_playlist_once() { lock_guard lock(queue_state_mu); if (splice_ready) { - fprintf(stderr, "splicing\n"); if (next_clip == nullptr) { do_splice(to_splice_clip_list, clip_idx, -1, &clip_list); } else { @@ -506,11 +505,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 &clips) @@ -525,7 +525,7 @@ void Player::play(const vector &clips) void Player::splice_play(const vector &clips) { - lock_guard lock(queue_state_mu); + lock_guard lock(queue_state_mu); if (new_clip_ready) { queued_clip_list = clips; assert(!splice_ready); @@ -588,7 +588,7 @@ void Player::release_queue_spot() new_clip_changed.notify_all(); } -double compute_time_left(const vector &clips, size_t currently_playing_idx, double progress_currently_playing) +double compute_time_left(const vector &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;