[pulseaudio-commits] 2 commits - src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Mon Jan 21 23:07:55 PST 2013
src/pulsecore/card.c | 16 ++++++----------
src/pulsecore/device-port.c | 3 +++
2 files changed, 9 insertions(+), 10 deletions(-)
New commits:
commit dd6c8ae38f70277130662423a7eb6d7c132088a7
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Tue Jan 22 08:54:57 2013 +0200
card: Remove some unnecessary checks.
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 3077193..afabc95 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -181,20 +181,16 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
/* As a minor optimization we just steal the list instead of
* copying it here */
- c->profiles = data->profiles;
+ pa_assert_se(c->profiles = data->profiles);
data->profiles = NULL;
- c->ports = data->ports;
+ pa_assert_se(c->ports = data->ports);
data->ports = NULL;
- if (c->profiles) {
- PA_HASHMAP_FOREACH(profile, c->profiles, state)
- profile->card = c;
- }
+ PA_HASHMAP_FOREACH(profile, c->profiles, state)
+ profile->card = c;
- if (c->ports) {
- PA_HASHMAP_FOREACH(port, c->ports, state)
- port->card = c;
- }
+ PA_HASHMAP_FOREACH(port, c->ports, state)
+ port->card = c;
c->active_profile = NULL;
c->save_profile = FALSE;
commit 78df02dba61d4d9e4f89225ddf69d5cfcdc9d184
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Tue Jan 22 08:48:02 2013 +0200
device-port: Return early from pa_device_port_set_latency_offset() if the offset doesn't change.
This avoids sending change notifications when nothing changes.
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
index fa78e08..6d787ac 100644
--- a/src/pulsecore/device-port.c
+++ b/src/pulsecore/device-port.c
@@ -104,6 +104,9 @@ void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset) {
pa_assert(p);
+ if (offset == p->latency_offset)
+ return;
+
p->latency_offset = offset;
if (p->is_output) {
More information about the pulseaudio-commits
mailing list