Fix handling of PA_SINK_MESSAGE_GET_LATENCY
authorJoão Paulo Rechi Vita <joao.vita@gmail.com>
Fri, 15 Aug 2008 19:56:26 +0000 (16:56 -0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Sep 2008 22:12:06 +0000 (01:12 +0300)
src/modules/module-bt-device.c

index 3881dd8..4c2a92f 100644 (file)
@@ -526,6 +526,7 @@ static int bt_hw_constraint(struct userdata *u) {
 static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
     struct userdata *u = PA_SINK(o)->userdata;
 
+    pa_log/*_debug*/("got message: %d", code);
     switch (code) {
 
         case PA_SINK_MESSAGE_SET_STATE:
@@ -550,7 +551,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
             r = pa_smoother_get(u->smoother, pa_rtclock_usec());
             w = pa_bytes_to_usec(u->offset + u->memchunk.length, &u->sink->sample_spec);
             *((pa_usec_t*) data) = w > r ? w - r : 0;
-            break;
+            return 0;
         }
 
     }