From 2f3845ef51019070bf42a01fd140666fc3bc3609 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 23 Sep 2018 15:00:47 +0200 Subject: [PATCH] player/Thread: remove `buffered_before_play` from `decoder_wakeup_threshold` formula Simplify the formula, and I guess this makes the formula more reliable. Imagine somebody configured `buffered_before_play` larger than 25%; then the decoder would be woken up all the time. This doesn't seem logical. On the other hand, it's easy to understand that the decoder should be woken up below 75% buffer fill. --- src/player/Thread.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index 5b00d2a57..13477fe0a 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -185,8 +185,7 @@ public: Player(PlayerControl &_pc, DecoderControl &_dc, MusicBuffer &_buffer) noexcept :pc(_pc), dc(_dc), buffer(_buffer), - decoder_wakeup_threshold((pc.buffered_before_play + - buffer.GetSize() * 3) / 4) + decoder_wakeup_threshold(buffer.GetSize() * 3 / 4) { }