static pa_bool_t installed = FALSE;
/* The current state of operation */
-static enum {
+static enum {
PHASE_IDLE, /* Normal state */
PHASE_SOFT /* After CPU overload has been detected */
} phase = PHASE_IDLE;
-terminate terminate esd daemone after last client exits
-nobeeps disable startup beeps
-trust start esd even if use of /tmp/.esd can be insecure
- -port PORT listen for connections at PORT (only for tcp/ip)
+ -port PORT listen for connections at PORT (only for tcp/ip)
-bind ADDRESS binds to ADDRESS (only for tcp/ip)
EOF
exit 0
dbus_message_iter_get_basic(i, &key);
- if (!dbus_message_iter_next(i)) {
+ if (!dbus_message_iter_next(i)) {
pa_log("Property value missing");
return -1;
}
dbus_message_iter_get_basic(i, &key);
- if (!dbus_message_iter_next(i)) {
+ if (!dbus_message_iter_next(i)) {
pa_log("Property value missing");
return -1;
}
break;
pa_log_error("Failed to write data to socket: %s", pa_cstrerror(errno));
- ret = -1;
+ ret = -1;
break;
}
struct ca_device {
AudioObjectID id;
- unsigned int module_index;
+ unsigned int module_index;
PA_LLIST_FIELDS(ca_device);
};
}
if (!found) {
- pa_log_debug("object id %d has been removed (module index %d) %p", (unsigned int) dev->id, dev->module_index, dev);
+ pa_log_debug("object id %d has been removed (module index %d) %p", (unsigned int) dev->id, dev->module_index, dev);
pa_module_unload_request_by_index(m->core, dev->module_index, TRUE);
PA_LLIST_REMOVE(ca_device, u->devices, dev);
pa_xfree(dev);
pa_assert(m);
pa_assert_se(u = m->userdata);
- return pa_sink_linked_by(u->sink) + pa_source_linked_by(u->source);
+ return pa_sink_linked_by(u->sink) + pa_source_linked_by(u->source);
}
void pa__done(pa_module*m) {
PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_USAGE(
"sink_name=<name for the sink> "
- "sink_properties=<properties for the card> "
+ "sink_properties=<properties for the card> "
"server_name=<jack server name> "
"client_name=<jack client name> "
"channels=<number of channels> "
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module *m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
pa_strlcpy(entry.icon, pa_strnull(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)), sizeof(entry.icon));
- } else if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE) {
+ } else if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE) {
pa_source *source;
pa_assert((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE);
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
#ifdef HAVE_DBUS
#endif
/* Called from IO thread context */
-static void check_smoother_status(struct userdata *u, pa_bool_t past) {
+static void check_smoother_status(struct userdata *u, pa_bool_t past) {
pa_usec_t x;
pa_assert(u);
pa_xfree(dn);
- return -1;
+ return -1;
}
void pa__done(pa_module*m) {
if (ma)
pa_modargs_free(ma);
- return -1;
+ return -1;
}
#include <glib.h>
#include "glib-mainloop.h"
-struct pa_io_event {
+struct pa_io_event {
pa_glib_mainloop *mainloop;
int dead;
typedef void (*pa_defer_event_destroy_cb_t)(pa_mainloop_api*a, pa_defer_event *e, void *userdata);
/** An abstract mainloop API vtable */
-struct pa_mainloop_api {
+struct pa_mainloop_api {
/** A pointer to some private, arbitrary data of the main loop implementation */
void *userdata;
if (pa_tagstruct_getu32(t, &s->channel) < 0 ||
s->channel == PA_INVALID_INDEX ||
- ((s->direction != PA_STREAM_UPLOAD) && (pa_tagstruct_getu32(t, &s->stream_index) < 0 || s->stream_index == PA_INVALID_INDEX)) ||
+ ((s->direction != PA_STREAM_UPLOAD) && (pa_tagstruct_getu32(t, &s->stream_index) < 0 || s->stream_index == PA_INVALID_INDEX)) ||
((s->direction != PA_STREAM_RECORD) && pa_tagstruct_getu32(t, &requested_bytes) < 0)) {
pa_context_fail(s->context, PA_ERR_PROTOCOL);
goto finish;
}
f = pa_sw_volume_to_dB(v);
- pa_snprintf(s, l, "%0.2f dB",
- isinf(f) < 0 || f <= PA_DECIBEL_MININFTY ? -INFINITY : f);
+ pa_snprintf(s, l, "%0.2f dB", isinf(f) < 0 || f <= PA_DECIBEL_MININFTY ? -INFINITY : f);
return s;
}
m = PA_MAX(left, right);
if (new_balance <= 0) {
- nright = (new_balance + 1.0f) * m;
+ nright = (new_balance + 1.0f) * m;
nleft = m;
- } else {
+ } else {
nleft = (1.0f - new_balance) * m;
nright = m;
}
return pa_cvolume_set(v, v->channels, max);
for (c = 0; c < v->channels; c++)
- v->values[c] = (pa_volume_t) PA_CLAMP_VOLUME(((uint64_t) v->values[c] * (uint64_t) max) / (uint64_t) t);
+ v->values[c] = (pa_volume_t) PA_CLAMP_VOLUME(((uint64_t) v->values[c] * (uint64_t) max) / (uint64_t) t);
return v;
}
m = PA_MAX(front, rear);
if (new_fade <= 0) {
- nfront = (new_fade + 1.0f) * m;
+ nfront = (new_fade + 1.0f) * m;
nrear = m;
- } else {
+ } else {
nrear = (1.0f - new_fade) * m;
nfront = m;
}
/* The following function is based on an example from the GNU libc
* documentation. This function is similar to GNU's asprintf(). */
char *pa_sprintf_malloc(const char *format, ...) {
- size_t size = 100;
+ size_t size = 100;
char *c = NULL;
pa_assert(format);
/* Same as the previous function, but use a va_list instead of an
* ellipsis */
char *pa_vsprintf_malloc(const char *format, va_list ap) {
- size_t size = 100;
+ size_t size = 100;
char *c = NULL;
pa_assert(format);
/* If PULSE_STATE_PATH and PULSE_RUNTIME_PATH point to the same
* dir then this will break. */
- if (pa_make_secure_dir(d, 0700U, (uid_t) -1, (gid_t) -1) < 0) {
+ if (pa_make_secure_dir(d, 0700U, (uid_t) -1, (gid_t) -1) < 0) {
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
pa_xfree(d);
return NULL;
if ((d = getenv("PULSE_RUNTIME_PATH"))) {
- if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
+ if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
goto fail;
}
if (!(d = get_pulse_home()))
goto fail;
- if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
+ if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
pa_xfree(d);
goto fail;
#if defined (__arm__) && defined (__linux__)
-#define MAX_BUFFER 4096
+#define MAX_BUFFER 4096
static char *
get_cpuinfo_line(char *cpuinfo, const char *tag) {
char *line, *end, *colon;
int pa_ip_acl_check(pa_ip_acl *acl, int fd) {
struct sockaddr_storage sa;
struct acl_entry *e;
- socklen_t salen;
+ socklen_t salen;
pa_assert(acl);
pa_assert(fd >= 0);
pa_free_cb_t free_cb;
} user;
- struct {
+ struct {
uint32_t id;
pa_memimport_segment *segment;
} imported;
key_len++;
break;
- case VALUE_START:
+ case VALUE_START:
if (*p == '\'') {
state = VALUE_TICKS;
value = p+1;
m->unload_requested = FALSE;
if (m->init(m) < 0) {
- pa_log_error("Failed to load module \"%s\" (argument: \"%s\"): initialization failed.", name, argument ? argument : "");
+ pa_log_error("Failed to load module \"%s\" (argument: \"%s\"): initialization failed.", name, argument ? argument : "");
goto fail;
}
else if (start == c->rrobin_index)
return;
- if (pa_memblockq_peek(r->memblockq, &chunk) >= 0) {
+ if (pa_memblockq_peek(r->memblockq, &chunk) >= 0) {
pa_memchunk schunk = chunk;
if (schunk.length > r->buffer_attr.fragsize)
if (name)
pa_proplist_sets(p, PA_PROP_MEDIA_NAME, name);
- if (c->version >= 12) {
+ if (c->version >= 12) {
/* Since 0.9.8 the user can ask for a couple of additional flags */
if (pa_tagstruct_get_boolean(t, &no_remap) < 0 ||
}
flags =
- (corked ? PA_SINK_INPUT_START_CORKED : 0) |
- (no_remap ? PA_SINK_INPUT_NO_REMAP : 0) |
- (no_remix ? PA_SINK_INPUT_NO_REMIX : 0) |
- (fix_format ? PA_SINK_INPUT_FIX_FORMAT : 0) |
- (fix_rate ? PA_SINK_INPUT_FIX_RATE : 0) |
- (fix_channels ? PA_SINK_INPUT_FIX_CHANNELS : 0) |
- (no_move ? PA_SINK_INPUT_DONT_MOVE : 0) |
- (variable_rate ? PA_SINK_INPUT_VARIABLE_RATE : 0) |
+ (corked ? PA_SINK_INPUT_START_CORKED : 0) |
+ (no_remap ? PA_SINK_INPUT_NO_REMAP : 0) |
+ (no_remix ? PA_SINK_INPUT_NO_REMIX : 0) |
+ (fix_format ? PA_SINK_INPUT_FIX_FORMAT : 0) |
+ (fix_rate ? PA_SINK_INPUT_FIX_RATE : 0) |
+ (fix_channels ? PA_SINK_INPUT_FIX_CHANNELS : 0) |
+ (no_move ? PA_SINK_INPUT_DONT_MOVE : 0) |
+ (variable_rate ? PA_SINK_INPUT_VARIABLE_RATE : 0) |
(dont_inhibit_auto_suspend ? PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND : 0) |
(fail_on_suspend ? PA_SINK_INPUT_NO_CREATE_ON_SUSPEND|PA_SINK_INPUT_KILL_ON_SUSPEND : 0) |
(passthrough ? PA_SINK_INPUT_PASSTHROUGH : 0);
if (name)
pa_proplist_sets(p, PA_PROP_MEDIA_NAME, name);
- if (c->version >= 12) {
+ if (c->version >= 12) {
/* Since 0.9.8 the user can ask for a couple of additional flags */
if (pa_tagstruct_get_boolean(t, &no_remap) < 0 ||
}
flags =
- (corked ? PA_SOURCE_OUTPUT_START_CORKED : 0) |
- (no_remap ? PA_SOURCE_OUTPUT_NO_REMAP : 0) |
- (no_remix ? PA_SOURCE_OUTPUT_NO_REMIX : 0) |
- (fix_format ? PA_SOURCE_OUTPUT_FIX_FORMAT : 0) |
- (fix_rate ? PA_SOURCE_OUTPUT_FIX_RATE : 0) |
- (fix_channels ? PA_SOURCE_OUTPUT_FIX_CHANNELS : 0) |
- (no_move ? PA_SOURCE_OUTPUT_DONT_MOVE : 0) |
- (variable_rate ? PA_SOURCE_OUTPUT_VARIABLE_RATE : 0) |
+ (corked ? PA_SOURCE_OUTPUT_START_CORKED : 0) |
+ (no_remap ? PA_SOURCE_OUTPUT_NO_REMAP : 0) |
+ (no_remix ? PA_SOURCE_OUTPUT_NO_REMIX : 0) |
+ (fix_format ? PA_SOURCE_OUTPUT_FIX_FORMAT : 0) |
+ (fix_rate ? PA_SOURCE_OUTPUT_FIX_RATE : 0) |
+ (fix_channels ? PA_SOURCE_OUTPUT_FIX_CHANNELS : 0) |
+ (no_move ? PA_SOURCE_OUTPUT_DONT_MOVE : 0) |
+ (variable_rate ? PA_SOURCE_OUTPUT_VARIABLE_RATE : 0) |
(dont_inhibit_auto_suspend ? PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND : 0) |
(fail_on_suspend ? PA_SOURCE_OUTPUT_NO_CREATE_ON_SUSPEND|PA_SOURCE_OUTPUT_KILL_ON_SUSPEND : 0);
if (!on_center(r->o_cm.map[oc]))
continue;
- for (ic = 0; ic < n_ic; ic++) {
+ for (ic = 0; ic < n_ic; ic++) {
if (ic_connected[ic]) {
m->map_table_f[oc][ic] *= .9f;
if (ncenter[oc] <= 0)
continue;
- for (ic = 0; ic < n_ic; ic++) {
+ for (ic = 0; ic < n_ic; ic++) {
if (ic_connected[ic]) {
m->map_table_f[oc][ic] *= .75f;
/* OK, so there is an unconnected LFE channel. Let's mix
* it into all channels, with factor 0.375 */
- for (ic = 0; ic < n_ic; ic++) {
+ for (ic = 0; ic < n_ic; ic++) {
if (!on_lfe(r->i_cm.map[ic]))
continue;
for (i = p->items; i; i = i->next) {
- if (i->n_pollfd > 0) {
+ if (i->n_pollfd > 0) {
size_t l = i->n_pollfd * sizeof(struct pollfd);
if (i->pollfd)
/* Called from main context */
void pa_sink_input_unlink(pa_sink_input *i) {
pa_bool_t linked;
- pa_source_output *o, *p = NULL;
+ pa_source_output *o, *p = NULL;
pa_assert(i);
pa_assert_ctl_context();
if (usec != (pa_usec_t) -1) {
pa_usec_t min_latency, max_latency;
pa_sink_get_latency_range(i->sink, &min_latency, &max_latency);
- usec = PA_CLAMP(usec, min_latency, max_latency);
+ usec = PA_CLAMP(usec, min_latency, max_latency);
}
}
memcpy(ITEM_TO_TEXT(n), s, size + 1);
n->next = l;
- return n;
+ return n;
}
char *pa_strlist_tostring(pa_strlist *l) {
s->abc_valid = FALSE;
#ifdef DEBUG_DATA
- pa_log_debug("%p, put(%llu | %llu) = %llu", s, (unsigned long long) (x + s->time_offset), (unsigned long long) x, (unsigned long long) y);
+ pa_log_debug("%p, put(%llu | %llu) = %llu", s, (unsigned long long) (x + s->time_offset), (unsigned long long) x, (unsigned long long) y);
#endif
}
return;
#ifdef DEBUG_DATA
- pa_log_debug("pause(%llu)", (unsigned long long) x);
+ pa_log_debug("pause(%llu)", (unsigned long long) x);
#endif
s->paused = TRUE;
p = pa_mempool_new(FALSE, 0);
- silence.memblock = pa_memblock_new_fixed(p, (char*) "__", 2, 1);
+ silence.memblock = pa_memblock_new_fixed(p, (char*) "__", 2, 1);
assert(silence.memblock);
silence.index = 0;
silence.length = pa_memblock_get_length(silence.memblock);
pa_assert(msec_upper > 0);
pa_assert(msec_upper >= msec_lower);
- pa_log_notice("Creating random latencies in the range of %ims to %ims.", msec_lower, msec_upper);
+ pa_log_notice("Creating random latencies in the range of %ims to %ims.", msec_lower, msec_upper);
for (n = 1; n < pa_ncpus(); n++) {
pa_assert_se(pa_thread_new("rtstutter", work, PA_UINT_TO_PTR(n)));
sample_length -= length;
- if (sample_length <= 0) {
+ if (sample_length <= 0) {
pa_stream_set_write_callback(sample_stream, NULL, NULL);
pa_stream_finish_upload(sample_stream);
}
#define DEBUG_LEVEL_ALWAYS 0
#define DEBUG_LEVEL_NORMAL 1
-#define DEBUG_LEVEL_VERBOSE 2
+#define DEBUG_LEVEL_VERBOSE 2
static void debug(int level, const char *format, ...) {
va_list ap;
*(int*) argp =
((v->values[0]*100/PA_VOLUME_NORM)) |
- ((v->values[v->channels > 1 ? 1 : 0]*100/PA_VOLUME_NORM) << 8);
+ ((v->values[v->channels > 1 ? 1 : 0]*100/PA_VOLUME_NORM) << 8);
pa_threaded_mainloop_unlock(i->mainloop);
case SNDCTL_DSP_GETCAPS:
debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_CAPS\n");
- *(int*) argp = DSP_CAP_DUPLEX | DSP_CAP_TRIGGER
+ *(int*) argp = DSP_CAP_DUPLEX | DSP_CAP_TRIGGER
#ifdef DSP_CAP_MULTI
| DSP_CAP_MULTI
#endif