fix x11 build
authorLennart Poettering <lennart@poettering.net>
Tue, 17 Aug 2004 18:53:42 +0000 (18:53 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Aug 2004 18:53:42 +0000 (18:53 +0000)
disable prebuf on drain

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@136 fefdeb5f-60dc-0310-8127-8f9354f1896f

polyp/Makefile.am
polyp/memblockq.c
polyp/memblockq.h
polyp/pacat.c
polyp/protocol-native.c

index 1f98251..5a49201 100644 (file)
@@ -272,7 +272,7 @@ if !X_DISPLAY_MISSING
 module_x11_bell_la_SOURCES = module-x11-bell.c
 module_x11_bell_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
 module_x11_bell_la_LDFLAGS = -module -avoid-version
-module_x11_bell_la_LIBADD = $(AM_LIBADD) $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIB)
+module_x11_bell_la_LIBADD = $(AM_LIBADD) $(X_PRE_LIBS) -lX11 $(X_LIBS) $(X_EXTRA_LIB)
 endif
 
 libpolyp_la_SOURCES = polyplib.h \
index 4019c89..8f499df 100644 (file)
@@ -323,3 +323,8 @@ uint32_t pa_memblockq_get_minreq(struct pa_memblockq *bq) {
     assert(bq);
     return bq->minreq;
 }
+
+void pa_memblockq_prebuf_disable(struct pa_memblockq *bq) {
+    assert(bq);
+    bq->prebuf = 0;
+}
index e6ad01d..4018470 100644 (file)
@@ -76,7 +76,10 @@ uint32_t pa_memblockq_get_length(struct pa_memblockq *bq);
 /* Return how many bytes are missing in queue to the specified fill amount */
 uint32_t pa_memblockq_missing(struct pa_memblockq *bq);
 
-
+/* Returns the minimal request value */
 uint32_t pa_memblockq_get_minreq(struct pa_memblockq *bq);
 
+/* Force disabling of pre-buf even when the pre-buffer is not yet filled */
+void pa_memblockq_prebuf_disable(struct pa_memblockq *bq);
+
 #endif
index 4f3bf00..2c7044b 100644 (file)
@@ -113,16 +113,13 @@ static void stream_state_callback(struct pa_stream *s, void *userdata) {
 
     switch (pa_stream_get_state(s)) {
         case PA_STREAM_CREATING:
+        case PA_STREAM_TERMINATED:
             break;
 
         case PA_STREAM_READY:
             fprintf(stderr, "Stream successfully created\n");
             break;
             
-        case PA_STREAM_TERMINATED:
-            quit(0);
-            break;
-            
         case PA_STREAM_FAILED:
         default:
             fprintf(stderr, "Stream errror: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
index 1fafc98..e86c78f 100644 (file)
@@ -748,12 +748,16 @@ static void command_drain_playback_stream(struct pa_pdispatch *pd, uint32_t comm
     }
 
     s->drain_request = 0;
+
+    pa_memblockq_prebuf_disable(s->memblockq);
     
     if (!pa_memblockq_is_readable(s->memblockq))
         pa_pstream_send_simple_ack(c->pstream, tag);
     else {
         s->drain_request = 1;
         s->drain_tag = tag;
+
+        pa_sink_notify(s->sink_input->sink);
     }
 }