[PATCH] native: Don't enable prebuffering when draining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64284
---
 src/pulsecore/protocol-native.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 96b6850..708878e 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1555,7 +1555,13 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
 
             windex = pa_memblockq_get_write_index(s->memblockq);
 
-            pa_memblockq_prebuf_force(s->memblockq);
+            /* We enable prebuffering so that after CORKED -> RUNNING
+             * transitions we don't have trouble with underruns in case the
+             * buffer has too little data. This must not be done when draining
+             * has been requested, however, otherwise the buffered audio would
+             * never play. */
+            if (!s->drain_request)
+                pa_memblockq_prebuf_force(s->memblockq);
 
             handle_seek(s, windex);
 
-- 
1.8.1.2

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux