From bce720c85dc5bade8b279af316bb112937a1e15d Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 23 Mar 2012 09:59:17 +0200 Subject: dbus: Fix device latency querying. --- src/modules/dbus/iface-device.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/dbus/iface-device.c b/src/modules/dbus/iface-device.c index df64d36e..a5af7304 100644 --- a/src/modules/dbus/iface-device.c +++ b/src/modules/dbus/iface-device.c @@ -598,13 +598,17 @@ static void handle_get_latency(DBusConnection *conn, DBusMessage *msg, void *use pa_assert(msg); pa_assert(d); - if (d->type == PA_DEVICE_TYPE_SINK && !(d->sink->flags & PA_SINK_LATENCY)) + if (d->type == PA_DEVICE_TYPE_SINK && !(d->sink->flags & PA_SINK_LATENCY)) { pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NO_SUCH_PROPERTY, "Sink %s doesn't support latency querying.", d->sink->name); - else if (d->type == PA_DEVICE_TYPE_SOURCE && !(d->source->flags & PA_SOURCE_LATENCY)) + return; + } + + if (d->type == PA_DEVICE_TYPE_SOURCE && !(d->source->flags & PA_SOURCE_LATENCY)) { pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NO_SUCH_PROPERTY, "Source %s doesn't support latency querying.", d->source->name); - return; + return; + } latency = (d->type == PA_DEVICE_TYPE_SINK) ? pa_sink_get_latency(d->sink) : pa_source_get_latency(d->source); -- cgit v1.2.3