aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index c5a51a00a..b82005aec 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -339,7 +339,13 @@ static void do_play(void)
sizeToTime) < 0)
break;
ob_shift();
- notify_signal(&dc.notify);
+
+ /* this formula should prevent that the
+ decoder gets woken up with each chunk; it
+ is more efficient to make it decode a
+ larger block at a time */
+ if (ob_available() <= (pc.buffered_before_play + ob.size * 3) / 4)
+ notify_signal(&dc.notify);
} else if (!ob_is_empty() && (int)ob.begin == next) {
/* at the beginning of a new song */