mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
minor modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1644 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
57734ec414
commit
06f2799d8f
1 changed files with 13 additions and 14 deletions
|
|
@ -26,7 +26,6 @@
|
|||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
|
@ -85,8 +84,8 @@ static pa_cvolume* parse_volume(const char *s, pa_cvolume *v) {
|
|||
long k;
|
||||
unsigned i;
|
||||
|
||||
assert(s);
|
||||
assert(v);
|
||||
pa_assert(s);
|
||||
pa_assert(v);
|
||||
|
||||
if (!isdigit(*s))
|
||||
return NULL;
|
||||
|
|
@ -170,7 +169,7 @@ static int load_rules(struct userdata *u) {
|
|||
continue;
|
||||
}
|
||||
|
||||
assert(ln == buf_source);
|
||||
pa_assert(ln == buf_source);
|
||||
|
||||
if (buf_volume[0]) {
|
||||
if (!parse_volume(buf_volume, &v)) {
|
||||
|
|
@ -297,8 +296,8 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
|
|||
struct rule *r;
|
||||
char *name;
|
||||
|
||||
assert(c);
|
||||
assert(u);
|
||||
pa_assert(c);
|
||||
pa_assert(u);
|
||||
|
||||
if (t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW) &&
|
||||
t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE) &&
|
||||
|
|
@ -313,7 +312,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
|
|||
if (!si->client || !(name = client_name(si->client)))
|
||||
return;
|
||||
} else {
|
||||
assert((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT);
|
||||
pa_assert((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT);
|
||||
|
||||
if (!(so = pa_idxset_get_by_index(c->source_outputs, idx)))
|
||||
return;
|
||||
|
|
@ -341,7 +340,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
|
|||
u->modified = 1;
|
||||
}
|
||||
} else {
|
||||
assert(so);
|
||||
pa_assert(so);
|
||||
|
||||
if (!r->source || strcmp(so->source->name, r->source) != 0) {
|
||||
pa_log_info("Saving source for <%s>", r->name);
|
||||
|
|
@ -363,7 +362,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
|
|||
r->sink = pa_xstrdup(si->sink->name);
|
||||
r->source = NULL;
|
||||
} else {
|
||||
assert(so);
|
||||
pa_assert(so);
|
||||
r->volume_is_set = 0;
|
||||
r->sink = NULL;
|
||||
r->source = pa_xstrdup(so->source->name);
|
||||
|
|
@ -378,7 +377,7 @@ static pa_hook_result_t sink_input_hook_callback(pa_core *c, pa_sink_input_new_d
|
|||
struct rule *r;
|
||||
char *name;
|
||||
|
||||
assert(data);
|
||||
pa_assert(data);
|
||||
|
||||
if (!data->client || !(name = client_name(data->client)))
|
||||
return PA_HOOK_OK;
|
||||
|
|
@ -405,7 +404,7 @@ static pa_hook_result_t source_output_hook_callback(pa_core *c, pa_source_output
|
|||
struct rule *r;
|
||||
char *name;
|
||||
|
||||
assert(data);
|
||||
pa_assert(data);
|
||||
|
||||
if (!data->client || !(name = client_name(data->client)))
|
||||
return PA_HOOK_OK;
|
||||
|
|
@ -424,7 +423,7 @@ int pa__init(pa_module*m) {
|
|||
pa_modargs *ma = NULL;
|
||||
struct userdata *u;
|
||||
|
||||
assert(m);
|
||||
pa_assert(m);
|
||||
|
||||
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
|
||||
pa_log("Failed to parse module arguments");
|
||||
|
|
@ -460,7 +459,7 @@ fail:
|
|||
|
||||
static void free_func(void *p, void *userdata) {
|
||||
struct rule *r = p;
|
||||
assert(r);
|
||||
pa_assert(r);
|
||||
|
||||
pa_xfree(r->name);
|
||||
pa_xfree(r->sink);
|
||||
|
|
@ -471,7 +470,7 @@ static void free_func(void *p, void *userdata) {
|
|||
void pa__done(pa_module*m) {
|
||||
struct userdata* u;
|
||||
|
||||
assert(m);
|
||||
pa_assert(m);
|
||||
|
||||
if (!(u = m->userdata))
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue