]> git.sesse.net Git - nageru/commitdiff
Fix a minor unneeded unlock/lock.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 27 Dec 2018 23:31:45 +0000 (00:31 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 27 Dec 2018 23:31:45 +0000 (00:31 +0100)
futatabi/player.cpp

index d75cdd2cf47d8a1b38a6393ff6c92a9e9fbf35a0..b7ceb0359968567d9bdc36ef69966768281a5f27 100644 (file)
@@ -436,6 +436,8 @@ void Player::play(const vector<Clip> &clips)
 
 void Player::override_angle(unsigned stream_idx)
 {
+       int64_t last_pts;
+
        // Corner case: If a new clip is waiting to be played, change its stream and then we're done.
        {
                unique_lock<mutex> lock(queue_state_mu);
@@ -452,14 +454,10 @@ void Player::override_angle(unsigned stream_idx)
                        new_clip_changed.notify_all();
                        return;
                }
-       }
 
-       // OK, so we're standing still, presumably at the end of a clip.
-       // Look at the last frame played (if it exists), and show the closest
-       // thing we've got.
-       int64_t last_pts;
-       {
-               lock_guard<mutex> lock(queue_state_mu);
+               // OK, so we're standing still, presumably at the end of a clip.
+               // Look at the last frame played (if it exists), and show the closest
+               // thing we've got.
                if (last_pts_played < 0) {
                        return;
                }