Skip to content

Commit

Permalink
Merge pull request #3875 from alexlnkp/master
Browse files Browse the repository at this point in the history
fix: never sleep cava when sleep_timer is 0
  • Loading branch information
Alexays authored Jan 10, 2025
2 parents 9d9f1d6 + 6a29abb commit 369c81d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/cava.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ auto waybar::modules::Cava::update() -> void {
}
}

if (silence_ && prm_.sleep_timer) {
if (silence_ && prm_.sleep_timer != 0) {
if (sleep_counter_ <=
(int)(std::chrono::milliseconds(prm_.sleep_timer * 1s) / frame_time_milsec_)) {
++sleep_counter_;
silence_ = false;
}
}

if (!silence_) {
if (!silence_ || prm_.sleep_timer == 0) {
downThreadDelay(frame_time_milsec_, suspend_silence_delay_);
// Process: execute cava
pthread_mutex_lock(&audio_data_.lock);
Expand Down

0 comments on commit 369c81d

Please sign in to comment.