summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-01 04:54:18 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-01 04:54:18 +0200
commit6b6d14626d5ae8b49edd1abe8ecc2432262358c9 (patch)
tree714fc93ef60b4ed3eb2ad54123b733c711e81f00 /src/modules/alsa/alsa-sink.c
parentdfe3f90b377a9cb2b158088c529a691086490afa (diff)
alsa: distuingish real underruns from left_to_play=0
Diffstat (limited to 'src/modules/alsa/alsa-sink.c')
-rw-r--r--src/modules/alsa/alsa-sink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 07d53880..afea8e08 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -410,6 +410,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t on_timeout) {
size_t left_to_play;
+ pa_bool_t underrun = FALSE;
/* We use <= instead of < for this check here because an underrun
* only happens after the last sample was processed, not already when
@@ -422,6 +423,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o
/* We got a dropout. What a mess! */
left_to_play = 0;
+ underrun = TRUE;
#ifdef DEBUG_TIMING
PA_DEBUG_TRAP;
@@ -443,7 +445,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o
pa_bool_t reset_not_before = TRUE;
if (!u->first && !u->after_rewind) {
- if (left_to_play < u->watermark_inc_threshold)
+ if (underrun || left_to_play < u->watermark_inc_threshold)
increase_watermark(u);
else if (left_to_play > u->watermark_dec_threshold) {
reset_not_before = FALSE;