From: Steinar H. Gunderson Date: Thu, 27 Dec 2018 23:31:45 +0000 (+0100) Subject: Fix a minor unneeded unlock/lock. X-Git-Tag: 1.8.1~26 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=add8bb3a499cfeaad58bf5bdbda68391bab64059;hp=bf07742d4ee1717c27d5af75e8d97a59e78699b9 Fix a minor unneeded unlock/lock. --- diff --git a/futatabi/player.cpp b/futatabi/player.cpp index d75cdd2..b7ceb03 100644 --- a/futatabi/player.cpp +++ b/futatabi/player.cpp @@ -436,6 +436,8 @@ void Player::play(const vector &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 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 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; }