[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test6-13-g44b7982
Lennart Poettering
gitmailer-noreply at 0pointer.de
Wed Aug 26 11:05:58 PDT 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 4614412f94eef8ed65076c6fc76b463547f8f072 (commit)
- Log -----------------------------------------------------------------
44b7982 pdispatch: various modernizations
34829eb pdispatch: add missing commands to command table
4e1298d llist: add PA_LLIST_FOREACH_SAFE macro for iteration that allows deleting
368c3e3 loopback: quieten gcc on 32bit
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-loopback.c | 2 +-
src/pulsecore/llist.h | 3 +++
src/pulsecore/pdispatch.c | 36 ++++++++++++++++++------------------
src/pulsecore/pdispatch.h | 6 +++---
4 files changed, 25 insertions(+), 22 deletions(-)
-----------------------------------------------------------------------
commit 368c3e3f904c7dba5ba8ba4b17d76ba49b40c6ae
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 26 20:05:19 2009 +0200
loopback: quieten gcc on 32bit
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index d9edbac..6e4f66d 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -172,7 +172,7 @@ static void adjust_rates(struct userdata *u) {
(double) u->latency_snapshot.source_latency / PA_USEC_PER_MSEC,
((double) u->latency_snapshot.sink_latency + buffer_latency + u->latency_snapshot.source_latency) / PA_USEC_PER_MSEC);
- pa_log_info("Should buffer %lu bytes, buffered at minimum %lu bytes",
+ pa_log_info("Should buffer %zu bytes, buffered at minimum %zu bytes",
u->latency_snapshot.max_request*2,
u->latency_snapshot.min_memblockq_length);
commit 4e1298d7c7a5dc01c2ef6e76d1520f2b04cb167a
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 26 20:05:48 2009 +0200
llist: add PA_LLIST_FOREACH_SAFE macro for iteration that allows deleting
diff --git a/src/pulsecore/llist.h b/src/pulsecore/llist.h
index 58b51c6..27f174a 100644
--- a/src/pulsecore/llist.h
+++ b/src/pulsecore/llist.h
@@ -107,4 +107,7 @@
#define PA_LLIST_FOREACH(i,head) \
for (i = (head); i; i = i->next)
+#define PA_LLIST_FOREACH_SAFE(i,n,head) \
+ for (i = (head); i && ((n = i->next), 1); i = n)
+
#endif
commit 34829eb07f4b76f72d8dc504f7e0dabc2e0b0744
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 26 20:06:24 2009 +0200
pdispatch: add missing commands to command table
diff --git a/src/pulsecore/pdispatch.c b/src/pulsecore/pdispatch.c
index fc8ce76..7d4e8c4 100644
--- a/src/pulsecore/pdispatch.c
+++ b/src/pulsecore/pdispatch.c
@@ -169,7 +169,7 @@ static const char *command_names[PA_COMMAND_MAX] = {
/* Supported since protocol v14 (0.9.12) */
[PA_COMMAND_EXTENSION] = "EXTENSION",
-
+ /* Supported since protocol v15 (0.9.15) */
[PA_COMMAND_GET_CARD_INFO] = "GET_CARD_INFO",
[PA_COMMAND_GET_CARD_INFO_LIST] = "GET_CARD_INFO_LIST",
[PA_COMMAND_SET_CARD_PROFILE] = "SET_CARD_PROFILE",
@@ -180,7 +180,11 @@ static const char *command_names[PA_COMMAND_MAX] = {
/* SERVER->CLIENT */
[PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED] = "PLAYBACK_BUFFER_ATTR_CHANGED",
- [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = "RECORD_BUFFER_ATTR_CHANGED"
+ [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = "RECORD_BUFFER_ATTR_CHANGED",
+
+ /* Supported since protocol v16 (0.9.16) */
+ [PA_COMMAND_SET_SINK_PORT] = "SET_SINK_PORT",
+ [PA_COMMAND_SET_SOURCE_PORT] = "SET_SOURCE_PORT"
};
#endif
commit 44b798237a62707ec5f8b1fd70bb7e6f7efc509c
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 26 20:07:04 2009 +0200
pdispatch: various modernizations
diff --git a/src/pulsecore/pdispatch.c b/src/pulsecore/pdispatch.c
index 7d4e8c4..f15466c 100644
--- a/src/pulsecore/pdispatch.c
+++ b/src/pulsecore/pdispatch.c
@@ -207,10 +207,10 @@ struct pa_pdispatch {
const pa_pdispatch_cb_t *callback_table;
unsigned n_commands;
PA_LLIST_HEAD(struct reply_info, replies);
- pa_pdispatch_drain_callback drain_callback;
+ pa_pdispatch_drain_cb_t drain_callback;
void *drain_userdata;
const pa_creds *creds;
- pa_bool_t use_rtclock:1;
+ pa_bool_t use_rtclock;
};
static void reply_info_free(struct reply_info *r) {
@@ -229,19 +229,16 @@ static void reply_info_free(struct reply_info *r) {
pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *mainloop, pa_bool_t use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries) {
pa_pdispatch *pd;
- pa_assert(mainloop);
+ pa_assert(mainloop);
pa_assert((entries && table) || (!entries && !table));
- pd = pa_xnew(pa_pdispatch, 1);
+ pd = pa_xnew0(pa_pdispatch, 1);
PA_REFCNT_INIT(pd);
pd->mainloop = mainloop;
pd->callback_table = table;
pd->n_commands = entries;
PA_LLIST_HEAD_INIT(struct reply_info, pd->replies);
- pd->drain_callback = NULL;
- pd->drain_userdata = NULL;
- pd->creds = NULL;
pd->use_rtclock = use_rtclock;
return pd;
@@ -321,7 +318,7 @@ int pa_pdispatch_run(pa_pdispatch *pd, pa_packet*packet, const pa_creds *creds,
if (command == PA_COMMAND_ERROR || command == PA_COMMAND_REPLY) {
struct reply_info *r;
- for (r = pd->replies; r; r = r->next)
+ PA_LLIST_FOREACH(r, pd->replies)
if (r->tag == tag)
break;
@@ -329,9 +326,9 @@ int pa_pdispatch_run(pa_pdispatch *pd, pa_packet*packet, const pa_creds *creds,
run_action(pd, r, command, ts);
} else if (pd->callback_table && (command < pd->n_commands) && pd->callback_table[command]) {
- const pa_pdispatch_cb_t *c = pd->callback_table+command;
+ const pa_pdispatch_cb_t *cb = pd->callback_table+command;
- (*c)(pd, command, tag, ts, userdata);
+ (*cb)(pd, command, tag, ts, userdata);
} else {
pa_log("Received unsupported command %u", command);
goto finish;
@@ -379,7 +376,9 @@ void pa_pdispatch_register_reply(pa_pdispatch *pd, uint32_t tag, int timeout, pa
r->free_cb = free_cb;
r->tag = tag;
- pa_assert_se(r->time_event = pd->mainloop->time_new(pd->mainloop, pa_timeval_rtstore(&tv, pa_rtclock_now() + timeout * PA_USEC_PER_SEC, pd->use_rtclock), timeout_callback, r));
+ pa_assert_se(r->time_event = pd->mainloop->time_new(pd->mainloop,
+ pa_timeval_rtstore(&tv, pa_rtclock_now() + timeout * PA_USEC_PER_SEC, pd->use_rtclock),
+ timeout_callback, r));
PA_LLIST_PREPEND(struct reply_info, pd->replies, r);
}
@@ -391,7 +390,7 @@ int pa_pdispatch_is_pending(pa_pdispatch *pd) {
return !!pd->replies;
}
-void pa_pdispatch_set_drain_callback(pa_pdispatch *pd, void (*cb)(pa_pdispatch *pd, void *userdata), void *userdata) {
+void pa_pdispatch_set_drain_callback(pa_pdispatch *pd, pa_pdispatch_drain_cb_t cb, void *userdata) {
pa_assert(pd);
pa_assert(PA_REFCNT_VALUE(pd) >= 1);
pa_assert(!cb || pa_pdispatch_is_pending(pd));
@@ -406,12 +405,9 @@ void pa_pdispatch_unregister_reply(pa_pdispatch *pd, void *userdata) {
pa_assert(pd);
pa_assert(PA_REFCNT_VALUE(pd) >= 1);
- for (r = pd->replies; r; r = n) {
- n = r->next;
-
+ PA_LLIST_FOREACH_SAFE(r, n, pd->replies)
if (r->userdata == userdata)
reply_info_free(r);
- }
}
void pa_pdispatch_unref(pa_pdispatch *pd) {
diff --git a/src/pulsecore/pdispatch.h b/src/pulsecore/pdispatch.h
index dae475a..c5431c2 100644
--- a/src/pulsecore/pdispatch.h
+++ b/src/pulsecore/pdispatch.h
@@ -35,9 +35,9 @@
typedef struct pa_pdispatch pa_pdispatch;
typedef void (*pa_pdispatch_cb_t)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
-typedef void (*pa_pdispatch_drain_callback)(pa_pdispatch *pd, void *userdata);
+typedef void (*pa_pdispatch_drain_cb_t)(pa_pdispatch *pd, void *userdata);
-pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *m, pa_bool_t use_rtclock, const pa_pdispatch_cb_t*table, unsigned entries);
+pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *m, pa_bool_t use_rtclock, const pa_pdispatch_cb_t *table, unsigned entries);
void pa_pdispatch_unref(pa_pdispatch *pd);
pa_pdispatch* pa_pdispatch_ref(pa_pdispatch *pd);
@@ -47,7 +47,7 @@ void pa_pdispatch_register_reply(pa_pdispatch *pd, uint32_t tag, int timeout, pa
int pa_pdispatch_is_pending(pa_pdispatch *pd);
-void pa_pdispatch_set_drain_callback(pa_pdispatch *pd, pa_pdispatch_drain_callback callback, void *userdata);
+void pa_pdispatch_set_drain_callback(pa_pdispatch *pd, pa_pdispatch_drain_cb_t callback, void *userdata);
/* Remove all reply slots with the give userdata parameter */
void pa_pdispatch_unregister_reply(pa_pdispatch *pd, void *userdata);
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list