]> code.delx.au - pulseaudio/commitdiff
native: Don't enable prebuffering when draining
authorTanu Kaskinen <tanu.kaskinen@intel.com>
Tue, 7 May 2013 15:00:34 +0000 (18:00 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 11 Jun 2013 10:46:44 +0000 (13:46 +0300)
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64284
src/pulsecore/protocol-native.c

index 96b6850b369af5de7c835be19232de060a18bb97..708878ed184dd0027968dee282c365957acd7b52 100644 (file)
@@ -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);