]> git.sesse.net Git - nageru/blobdiff - futatabi/player.cpp
Fix an issue where the stop button would get grayed out if restarting playing.
[nageru] / futatabi / player.cpp
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)