From 72f2abe1fe64ad62dfd6c7fa7b3435a5d4aa111b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 29 Dec 2018 00:13:06 +0100 Subject: [PATCH 1/1] Fix an issue where the stop button would get grayed out if restarting playing. --- futatabi/mainwindow.cpp | 1 + futatabi/player.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/futatabi/mainwindow.cpp b/futatabi/mainwindow.cpp index 1ed95c3..d73f579 100644 --- a/futatabi/mainwindow.cpp +++ b/futatabi/mainwindow.cpp @@ -514,6 +514,7 @@ void MainWindow::stop_clicked() fake_clip.pts_out = 0; playlist_clips->set_progress({}); live_player->play(fake_clip); + ui->stop_btn->setEnabled(false); } void MainWindow::live_player_done() diff --git a/futatabi/player.cpp b/futatabi/player.cpp index f8eb57e..6f329ef 100644 --- a/futatabi/player.cpp +++ b/futatabi/player.cpp @@ -50,9 +50,6 @@ void Player::thread_func(AVFormatContext *file_avctx) while (!should_quit) { play_playlist_once(); - if (done_callback != nullptr) { - done_callback(); - } } } @@ -405,6 +402,10 @@ void Player::play_playlist_once() in_pts_origin = next_clip->pts_in + lrint(next_clip_fade_time * TIMEBASE * clip->speed); } } + + if (done_callback != nullptr) { + done_callback(); + } } void Player::display_single_frame(int primary_stream_idx, const FrameOnDisk &primary_frame, int secondary_stream_idx, const FrameOnDisk &secondary_frame, double fade_alpha, steady_clock::time_point frame_start, bool snapped) -- 2.39.2