Skip to content

Fix fail_timer duration multiplication#2442

Merged
MaxKellermann merged 1 commit intoMusicPlayerDaemon:masterfrom
slqy123:v0.24.x
Mar 11, 2026
Merged

Fix fail_timer duration multiplication#2442
MaxKellermann merged 1 commit intoMusicPlayerDaemon:masterfrom
slqy123:v0.24.x

Conversation

@slqy123
Copy link
Contributor

@slqy123 slqy123 commented Mar 2, 2026

Remove incorrect * 1000 multiplier in fail_timer.Check() call.

When the PeriodClock API was migrated to std::chrono in commit 4011899 , the fail_timer.Check() call was not updated. This caused the timer to check for a duration that was 1000 times longer than intended.

// before
static constexpr unsigned REOPEN_AFTER = 10;
// after
static constexpr PeriodClock::Duration REOPEN_AFTER = std::chrono::seconds(10);

// It actually waits 10000 seconds
fail_timer.Check(REOPEN_AFTER * 1000);

Remove incorrect `* 1000` multiplier in fail_timer.Check() call.

When the PeriodClock API was migrated to std::chrono in commit 4011899
, the fail_timer.Check() call was not updated. This caused the timer
to check for a duration that was 1000 times longer than intended.
@MaxKellermann
Copy link
Member

Wow, this bug has survived a loooong time!

@slqy123
Copy link
Contributor Author

slqy123 commented Mar 2, 2026

Wow, this bug has survived a loooong time!

Yes. This may fixes #361, #1630 (maybe? I still get playing silence to avoid xrun while debugging, but the stream reconnects successfully after the retry delay)

@MaxKellermann MaxKellermann merged commit 0439ea1 into MusicPlayerDaemon:master Mar 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants