]> git.sesse.net Git - nageru/commitdiff
Fix an issue where the stop button would get grayed out if restarting playing.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 28 Dec 2018 23:13:06 +0000 (00:13 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 28 Dec 2018 23:13:06 +0000 (00:13 +0100)
futatabi/mainwindow.cpp
futatabi/player.cpp

index 1ed95c3dc5ab8ed27577510eda88577d6e5efdb5..d73f579a9e6faee5880c6ac2447004a1df6cc99c 100644 (file)
@@ -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()
index f8eb57eb58692b23d1992fb7f6dbd5e5ad9174bf..6f329ef506e7ae3df18865d685ef92682b538ae7 100644 (file)
@@ -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)