mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
and:
sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
-e '181,194!s/\bTRUE\b/true/' -e \
'181,194!s/\bFALSE\b/false/' pulsecore/macro.h
This commit is contained in:
parent
e9822bfcb0
commit
d806b19714
288 changed files with 3360 additions and 3360 deletions
|
|
@ -470,7 +470,7 @@ int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) {
|
|||
|
||||
char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) {
|
||||
unsigned channel;
|
||||
pa_bool_t first = TRUE;
|
||||
bool first = true;
|
||||
char *e;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -492,7 +492,7 @@ char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) {
|
|||
pa_channel_position_to_string(map->map[channel]));
|
||||
|
||||
e = strchr(e, 0);
|
||||
first = FALSE;
|
||||
first = false;
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
@ -693,7 +693,7 @@ const char* pa_channel_map_to_name(const pa_channel_map *map) {
|
|||
memset(in_map, 0, sizeof(in_map));
|
||||
|
||||
for (c = 0; c < map->channels; c++)
|
||||
pa_bitset_set(in_map, map->map[c], TRUE);
|
||||
pa_bitset_set(in_map, map->map[c], true);
|
||||
|
||||
if (pa_bitset_equals(in_map, PA_CHANNEL_POSITION_MAX,
|
||||
PA_CHANNEL_POSITION_MONO, -1))
|
||||
|
|
@ -747,7 +747,7 @@ const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) {
|
|||
memset(in_map, 0, sizeof(in_map));
|
||||
|
||||
for (c = 0; c < map->channels; c++)
|
||||
pa_bitset_set(in_map, map->map[c], TRUE);
|
||||
pa_bitset_set(in_map, map->map[c], true);
|
||||
|
||||
pa_init_i18n();
|
||||
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ mapping, i.e.\ "Stereo", "Surround 7.1" and so on. If the channel
|
|||
mapping is unknown NULL will be returned. \since 0.9.15 */
|
||||
const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
|
||||
|
||||
/** Returns TRUE if the specified channel position is available at
|
||||
/** Returns true if the specified channel position is available at
|
||||
* least once in the channel map. \since 0.9.16 */
|
||||
int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) PA_GCC_PURE;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
|
|||
}
|
||||
|
||||
if (pa_x11_get_prop(xcb, screen, "PULSE_SERVER", t, sizeof(t))) {
|
||||
pa_bool_t disable_autospawn = TRUE;
|
||||
bool disable_autospawn = true;
|
||||
|
||||
pa_xfree(c->default_server);
|
||||
c->default_server = pa_xstrdup(t);
|
||||
|
|
@ -71,13 +71,13 @@ int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
|
|||
|
||||
if ((id = pa_session_id())) {
|
||||
if (pa_streq(t, id))
|
||||
disable_autospawn = FALSE;
|
||||
disable_autospawn = false;
|
||||
pa_xfree(id);
|
||||
}
|
||||
}
|
||||
|
||||
if (disable_autospawn)
|
||||
c->autospawn = FALSE;
|
||||
c->autospawn = false;
|
||||
}
|
||||
|
||||
if (pa_x11_get_prop(xcb, screen, "PULSE_SINK", t, sizeof(t))) {
|
||||
|
|
@ -101,7 +101,7 @@ int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
|
|||
pa_assert(sizeof(cookie) == sizeof(c->cookie));
|
||||
memcpy(c->cookie, cookie, sizeof(cookie));
|
||||
|
||||
c->cookie_valid = TRUE;
|
||||
c->cookie_valid = true;
|
||||
|
||||
pa_xfree(c->cookie_file);
|
||||
c->cookie_file = NULL;
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ static const pa_client_conf default_conf = {
|
|||
.default_source = NULL,
|
||||
.default_server = NULL,
|
||||
.default_dbus_server = NULL,
|
||||
.autospawn = TRUE,
|
||||
.disable_shm = FALSE,
|
||||
.autospawn = true,
|
||||
.disable_shm = false,
|
||||
.cookie_file = NULL,
|
||||
.cookie_valid = FALSE,
|
||||
.cookie_valid = false,
|
||||
.shm_size = 0,
|
||||
.auto_connect_localhost = FALSE,
|
||||
.auto_connect_display = FALSE
|
||||
.auto_connect_localhost = false,
|
||||
.auto_connect_display = false
|
||||
};
|
||||
|
||||
pa_client_conf *pa_client_conf_new(void) {
|
||||
|
|
@ -159,7 +159,7 @@ int pa_client_conf_env(pa_client_conf *c) {
|
|||
c->default_server = pa_xstrdup(e);
|
||||
|
||||
/* We disable autospawning automatically if a specific server was set */
|
||||
c->autospawn = FALSE;
|
||||
c->autospawn = false;
|
||||
}
|
||||
|
||||
if ((e = getenv(ENV_DAEMON_BINARY))) {
|
||||
|
|
@ -182,24 +182,24 @@ int pa_client_conf_load_cookie(pa_client_conf* c) {
|
|||
|
||||
pa_assert(c);
|
||||
|
||||
c->cookie_valid = FALSE;
|
||||
c->cookie_valid = false;
|
||||
|
||||
if (c->cookie_file)
|
||||
k = pa_authkey_load_auto(c->cookie_file, TRUE, c->cookie, sizeof(c->cookie));
|
||||
k = pa_authkey_load_auto(c->cookie_file, true, c->cookie, sizeof(c->cookie));
|
||||
else {
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, FALSE, c->cookie, sizeof(c->cookie));
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, false, c->cookie, sizeof(c->cookie));
|
||||
|
||||
if (k < 0) {
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE_FALLBACK, FALSE, c->cookie, sizeof(c->cookie));
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE_FALLBACK, false, c->cookie, sizeof(c->cookie));
|
||||
|
||||
if (k < 0)
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, TRUE, c->cookie, sizeof(c->cookie));
|
||||
k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, true, c->cookie, sizeof(c->cookie));
|
||||
}
|
||||
}
|
||||
|
||||
if (k < 0)
|
||||
return k;
|
||||
|
||||
c->cookie_valid = TRUE;
|
||||
c->cookie_valid = true;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
typedef struct pa_client_conf {
|
||||
char *daemon_binary, *extra_arguments, *default_sink, *default_source, *default_server, *default_dbus_server, *cookie_file;
|
||||
pa_bool_t autospawn, disable_shm, auto_connect_localhost, auto_connect_display;
|
||||
bool autospawn, disable_shm, auto_connect_localhost, auto_connect_display;
|
||||
uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
|
||||
pa_bool_t cookie_valid; /* non-zero, when cookie is valid */
|
||||
bool cookie_valid; /* non-zero, when cookie is valid */
|
||||
size_t shm_size;
|
||||
} pa_client_conf;
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
|
|||
if (!(c->mempool = pa_mempool_new(!c->conf->disable_shm, c->conf->shm_size))) {
|
||||
|
||||
if (!c->conf->disable_shm)
|
||||
c->mempool = pa_mempool_new(FALSE, c->conf->shm_size);
|
||||
c->mempool = pa_mempool_new(false, c->conf->shm_size);
|
||||
|
||||
if (!c->mempool) {
|
||||
context_free(c);
|
||||
|
|
@ -353,10 +353,10 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, int64_t o
|
|||
if ((s = pa_hashmap_get(c->record_streams, PA_UINT32_TO_PTR(channel)))) {
|
||||
|
||||
if (chunk->memblock) {
|
||||
pa_memblockq_seek(s->record_memblockq, offset, seek, TRUE);
|
||||
pa_memblockq_seek(s->record_memblockq, offset, seek, true);
|
||||
pa_memblockq_push_align(s->record_memblockq, chunk);
|
||||
} else
|
||||
pa_memblockq_seek(s->record_memblockq, offset+chunk->length, seek, TRUE);
|
||||
pa_memblockq_seek(s->record_memblockq, offset+chunk->length, seek, true);
|
||||
|
||||
if (s->read_callback) {
|
||||
size_t l;
|
||||
|
|
@ -369,7 +369,7 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, int64_t o
|
|||
pa_context_unref(c);
|
||||
}
|
||||
|
||||
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, pa_bool_t fail) {
|
||||
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, bool fail) {
|
||||
uint32_t err;
|
||||
pa_assert(c);
|
||||
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||
|
|
@ -418,14 +418,14 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
pa_context_ref(c);
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
pa_context_handle_error(c, command, t, TRUE);
|
||||
pa_context_handle_error(c, command, t, true);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
switch(c->state) {
|
||||
case PA_CONTEXT_AUTHORIZING: {
|
||||
pa_tagstruct *reply;
|
||||
pa_bool_t shm_on_remote = FALSE;
|
||||
bool shm_on_remote = false;
|
||||
|
||||
if (pa_tagstruct_getu32(t, &c->version) < 0 ||
|
||||
!pa_tagstruct_eof(t)) {
|
||||
|
|
@ -452,7 +452,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
/* Enable shared memory support if possible */
|
||||
if (c->do_shm)
|
||||
if (c->version < 10 || (c->version >= 13 && !shm_on_remote))
|
||||
c->do_shm = FALSE;
|
||||
c->do_shm = false;
|
||||
|
||||
if (c->do_shm) {
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
#ifdef HAVE_CREDS
|
||||
const pa_creds *creds;
|
||||
if (!(creds = pa_pdispatch_creds(pd)) || getuid() != creds->uid)
|
||||
c->do_shm = FALSE;
|
||||
c->do_shm = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -707,7 +707,7 @@ static void track_pulseaudio_on_dbus(pa_context *c, DBusBusType type, pa_dbus_wr
|
|||
pa_log_warn("Failed to add filter function");
|
||||
goto fail;
|
||||
}
|
||||
c->filter_added = TRUE;
|
||||
c->filter_added = true;
|
||||
|
||||
if (pa_dbus_add_matches(
|
||||
pa_dbus_wrap_connection_get(*conn), &error,
|
||||
|
|
@ -751,7 +751,7 @@ static int try_next_connection(pa_context *c) {
|
|||
goto finish;
|
||||
|
||||
/* Autospawn only once */
|
||||
c->do_autospawn = FALSE;
|
||||
c->do_autospawn = false;
|
||||
|
||||
/* Connect only to per-user sockets this time */
|
||||
c->server_list = prepend_per_user(c->server_list);
|
||||
|
|
@ -830,7 +830,7 @@ finish:
|
|||
#ifdef HAVE_DBUS
|
||||
static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, void *userdata) {
|
||||
pa_context *c = userdata;
|
||||
pa_bool_t is_session;
|
||||
bool is_session;
|
||||
|
||||
pa_assert(bus);
|
||||
pa_assert(message);
|
||||
|
|
@ -879,7 +879,7 @@ int pa_context_connect(
|
|||
PA_CHECK_VALIDITY(c, !server || *server, PA_ERR_INVALID);
|
||||
|
||||
if (server)
|
||||
c->conf->autospawn = FALSE;
|
||||
c->conf->autospawn = false;
|
||||
else
|
||||
server = c->conf->default_server;
|
||||
|
||||
|
|
@ -932,7 +932,7 @@ int pa_context_connect(
|
|||
if (getuid() == 0)
|
||||
pa_log_debug("Not doing autospawn since we are root.");
|
||||
else {
|
||||
c->do_autospawn = TRUE;
|
||||
c->do_autospawn = true;
|
||||
|
||||
if (api)
|
||||
c->spawn_api = *api;
|
||||
|
|
@ -1088,7 +1088,7 @@ void pa_context_simple_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
success = 0;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ static void ext_device_manager_test_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
} else if (pa_tagstruct_getu32(t, &version) < 0 ||
|
||||
|
|
@ -118,7 +118,7 @@ static void ext_device_manager_read_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static void ext_device_restore_test_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
} else if (pa_tagstruct_getu32(t, &version) < 0 ||
|
||||
|
|
@ -164,7 +164,7 @@ static void ext_device_restore_read_device_formats_cb(pa_pdispatch *pd, uint32_t
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static void ext_stream_restore_test_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
} else if (pa_tagstruct_getu32(t, &version) < 0 ||
|
||||
|
|
@ -114,7 +114,7 @@ static void ext_stream_restore_read_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -122,7 +122,7 @@ static void ext_stream_restore_read_cb(pa_pdispatch *pd, uint32_t command, uint3
|
|||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_ext_stream_restore_info i;
|
||||
pa_bool_t mute = FALSE;
|
||||
bool mute = false;
|
||||
|
||||
memset(&i, 0, sizeof(i));
|
||||
|
||||
|
|
|
|||
|
|
@ -46,14 +46,14 @@ int pa_detect_fork(void) {
|
|||
|
||||
/* First let's check whether the current pid matches the stored one */
|
||||
if (stored_pid == getpid())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* Does it contain a different PID than ours? Then the process got forked. */
|
||||
if ((int) stored_pid != (int) -1)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/* Ok, it still contains no PID, then store it */
|
||||
if (pa_atomic_cmpxchg(&pid, (int) -1, (int) getpid()))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second)
|
|||
pa_assert(second);
|
||||
|
||||
if (first->encoding != second->encoding)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
while ((key = pa_proplist_iterate(first->plist, &state))) {
|
||||
const char *value_one, *value_two;
|
||||
|
|
@ -187,10 +187,10 @@ int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second)
|
|||
value_two = pa_proplist_gets(second->plist, key);
|
||||
|
||||
if (!value_two || !pa_format_info_prop_compatible(value_one, value_two))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
pa_format_info* pa_format_info_from_sample_spec(pa_sample_spec *ss, pa_channel_map *map) {
|
||||
|
|
@ -640,14 +640,14 @@ void pa_format_info_set_prop_string_array(pa_format_info *f, const char *key, co
|
|||
json_object_put(o);
|
||||
}
|
||||
|
||||
static pa_bool_t pa_json_is_fixed_type(json_object *o) {
|
||||
static bool pa_json_is_fixed_type(json_object *o) {
|
||||
switch(json_object_get_type(o)) {
|
||||
case json_type_object:
|
||||
case json_type_array:
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
default:
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -669,7 +669,7 @@ static int pa_format_info_prop_compatible(const char *one, const char *two) {
|
|||
goto out;
|
||||
|
||||
/* We don't deal with both values being non-fixed - just because there is no immediate need (FIXME) */
|
||||
pa_return_val_if_fail(pa_json_is_fixed_type(o1) || pa_json_is_fixed_type(o2), FALSE);
|
||||
pa_return_val_if_fail(pa_json_is_fixed_type(o1) || pa_json_is_fixed_type(o2), false);
|
||||
|
||||
if (pa_json_is_fixed_type(o1) && pa_json_is_fixed_type(o2)) {
|
||||
ret = pa_json_value_equal(o1, o2);
|
||||
|
|
|
|||
|
|
@ -85,13 +85,13 @@ struct pa_context {
|
|||
|
||||
pa_mempool *mempool;
|
||||
|
||||
pa_bool_t is_local:1;
|
||||
pa_bool_t do_shm:1;
|
||||
pa_bool_t server_specified:1;
|
||||
pa_bool_t no_fail:1;
|
||||
pa_bool_t do_autospawn:1;
|
||||
pa_bool_t use_rtclock:1;
|
||||
pa_bool_t filter_added:1;
|
||||
bool is_local:1;
|
||||
bool do_shm:1;
|
||||
bool server_specified:1;
|
||||
bool no_fail:1;
|
||||
bool do_autospawn:1;
|
||||
bool use_rtclock:1;
|
||||
bool filter_added:1;
|
||||
pa_spawn_api spawn_api;
|
||||
|
||||
pa_strlist *server_list;
|
||||
|
|
@ -122,9 +122,9 @@ struct pa_context {
|
|||
typedef struct pa_index_correction {
|
||||
uint32_t tag;
|
||||
int64_t value;
|
||||
pa_bool_t valid:1;
|
||||
pa_bool_t absolute:1;
|
||||
pa_bool_t corrupt:1;
|
||||
bool valid:1;
|
||||
bool absolute:1;
|
||||
bool corrupt:1;
|
||||
} pa_index_correction;
|
||||
|
||||
#define PA_MAX_FORMATS (PA_ENCODING_MAX)
|
||||
|
|
@ -150,11 +150,11 @@ struct pa_stream {
|
|||
|
||||
pa_proplist *proplist;
|
||||
|
||||
pa_bool_t channel_valid:1;
|
||||
pa_bool_t suspended:1;
|
||||
pa_bool_t corked:1;
|
||||
pa_bool_t timing_info_valid:1;
|
||||
pa_bool_t auto_timing_update_requested:1;
|
||||
bool channel_valid:1;
|
||||
bool suspended:1;
|
||||
bool corked:1;
|
||||
bool timing_info_valid:1;
|
||||
bool auto_timing_update_requested:1;
|
||||
|
||||
uint32_t channel;
|
||||
uint32_t syncid;
|
||||
|
|
@ -262,7 +262,7 @@ void pa_stream_simple_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
void pa_context_fail(pa_context *c, int error);
|
||||
int pa_context_set_error(pa_context *c, int error);
|
||||
void pa_context_set_state(pa_context *c, pa_context_state_t st);
|
||||
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, pa_bool_t fail);
|
||||
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, bool fail);
|
||||
pa_operation* pa_context_send_simple_command(pa_context *c, uint32_t command, void (*internal_callback)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata), void (*cb)(void), void *userdata);
|
||||
|
||||
void pa_stream_set_state(pa_stream *s, pa_stream_state_t st);
|
||||
|
|
@ -273,7 +273,7 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta
|
|||
do { \
|
||||
if (!(expression)) \
|
||||
return -pa_context_set_error((context), (error)); \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value) \
|
||||
do { \
|
||||
|
|
@ -281,7 +281,7 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta
|
|||
pa_context_set_error((context), (error)); \
|
||||
return value; \
|
||||
} \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error) \
|
||||
PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL)
|
||||
|
|
@ -289,13 +289,13 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta
|
|||
#define PA_FAIL(context, error) \
|
||||
do { \
|
||||
return -pa_context_set_error((context), (error)); \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define PA_FAIL_RETURN_ANY(context, error, value) \
|
||||
do { \
|
||||
pa_context_set_error((context), (error)); \
|
||||
return value; \
|
||||
} while(FALSE)
|
||||
} while(false)
|
||||
|
||||
#define PA_FAIL_RETURN_NULL(context, error) \
|
||||
PA_FAIL_RETURN_ANY(context, error, NULL)
|
||||
|
|
@ -304,6 +304,6 @@ void pa_ext_device_manager_command(pa_context *c, uint32_t tag, pa_tagstruct *t)
|
|||
void pa_ext_device_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
||||
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
||||
|
||||
pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m);
|
||||
bool pa_mainloop_is_our_api(pa_mainloop_api*m);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void context_stat_callback(pa_pdispatch *pd, uint32_t command, uint32_t t
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
p = NULL;
|
||||
|
|
@ -95,7 +95,7 @@ static void context_get_server_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
p = NULL;
|
||||
|
|
@ -151,14 +151,14 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
} else {
|
||||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_bool_t mute;
|
||||
bool mute;
|
||||
uint32_t flags;
|
||||
uint32_t state;
|
||||
const char *ap = NULL;
|
||||
|
|
@ -167,7 +167,7 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
i.proplist = pa_proplist_new();
|
||||
i.base_volume = PA_VOLUME_NORM;
|
||||
i.n_volume_steps = PA_VOLUME_NORM+1;
|
||||
mute = FALSE;
|
||||
mute = false;
|
||||
state = PA_SINK_INVALID_STATE;
|
||||
i.card = PA_INVALID_INDEX;
|
||||
|
||||
|
|
@ -424,14 +424,14 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
} else {
|
||||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_bool_t mute;
|
||||
bool mute;
|
||||
uint32_t flags;
|
||||
uint32_t state;
|
||||
const char *ap;
|
||||
|
|
@ -440,7 +440,7 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
i.proplist = pa_proplist_new();
|
||||
i.base_volume = PA_VOLUME_NORM;
|
||||
i.n_volume_steps = PA_VOLUME_NORM+1;
|
||||
mute = FALSE;
|
||||
mute = false;
|
||||
state = PA_SOURCE_INVALID_STATE;
|
||||
i.card = PA_INVALID_INDEX;
|
||||
|
||||
|
|
@ -692,7 +692,7 @@ static void context_get_client_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -870,7 +870,7 @@ static void context_get_card_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -1080,7 +1080,7 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -1088,7 +1088,7 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_module_info i;
|
||||
pa_bool_t auto_unload = FALSE;
|
||||
bool auto_unload = false;
|
||||
|
||||
pa_zero(i);
|
||||
i.proplist = pa_proplist_new();
|
||||
|
|
@ -1165,7 +1165,7 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -1173,7 +1173,7 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
|
|||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_sink_input_info i;
|
||||
pa_bool_t mute = FALSE, corked = FALSE, has_volume = FALSE, volume_writable = TRUE;
|
||||
bool mute = false, corked = false, has_volume = false, volume_writable = true;
|
||||
|
||||
pa_zero(i);
|
||||
i.proplist = pa_proplist_new();
|
||||
|
|
@ -1270,7 +1270,7 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -1278,7 +1278,7 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
|
|||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_source_output_info i;
|
||||
pa_bool_t mute = FALSE, corked = FALSE, has_volume = FALSE, volume_writable = TRUE;
|
||||
bool mute = false, corked = false, has_volume = false, volume_writable = true;
|
||||
|
||||
pa_zero(i);
|
||||
i.proplist = pa_proplist_new();
|
||||
|
|
@ -1676,7 +1676,7 @@ static void context_get_sample_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
eol = -1;
|
||||
|
|
@ -1684,7 +1684,7 @@ static void context_get_sample_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
while (!pa_tagstruct_eof(t)) {
|
||||
pa_sample_info i;
|
||||
pa_bool_t lazy = FALSE;
|
||||
bool lazy = false;
|
||||
|
||||
pa_zero(i);
|
||||
i.proplist = pa_proplist_new();
|
||||
|
|
@ -1823,7 +1823,7 @@ static void context_index_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
idx = PA_INVALID_INDEX;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
struct pa_io_event {
|
||||
pa_mainloop *mainloop;
|
||||
pa_bool_t dead:1;
|
||||
bool dead:1;
|
||||
|
||||
int fd;
|
||||
pa_io_event_flags_t events;
|
||||
|
|
@ -68,10 +68,10 @@ struct pa_io_event {
|
|||
|
||||
struct pa_time_event {
|
||||
pa_mainloop *mainloop;
|
||||
pa_bool_t dead:1;
|
||||
bool dead:1;
|
||||
|
||||
pa_bool_t enabled:1;
|
||||
pa_bool_t use_rtclock:1;
|
||||
bool enabled:1;
|
||||
bool use_rtclock:1;
|
||||
pa_usec_t time;
|
||||
|
||||
pa_time_event_cb_t callback;
|
||||
|
|
@ -83,9 +83,9 @@ struct pa_time_event {
|
|||
|
||||
struct pa_defer_event {
|
||||
pa_mainloop *mainloop;
|
||||
pa_bool_t dead:1;
|
||||
bool dead:1;
|
||||
|
||||
pa_bool_t enabled:1;
|
||||
bool enabled:1;
|
||||
|
||||
pa_defer_event_cb_t callback;
|
||||
void *userdata;
|
||||
|
|
@ -102,7 +102,7 @@ struct pa_mainloop {
|
|||
unsigned n_enabled_defer_events, n_enabled_time_events, n_io_events;
|
||||
unsigned io_events_please_scan, time_events_please_scan, defer_events_please_scan;
|
||||
|
||||
pa_bool_t rebuild_pollfds:1;
|
||||
bool rebuild_pollfds:1;
|
||||
struct pollfd *pollfds;
|
||||
unsigned max_pollfds, n_pollfds;
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ struct pa_mainloop {
|
|||
pa_mainloop_api api;
|
||||
|
||||
int retval;
|
||||
pa_bool_t quit:1;
|
||||
bool quit:1;
|
||||
|
||||
pa_atomic_t wakeup_requested;
|
||||
int wakeup_pipe[2];
|
||||
|
|
@ -176,7 +176,7 @@ static pa_io_event* mainloop_io_new(
|
|||
e->userdata = userdata;
|
||||
|
||||
PA_LLIST_PREPEND(pa_io_event, m->io_events, e);
|
||||
m->rebuild_pollfds = TRUE;
|
||||
m->rebuild_pollfds = true;
|
||||
m->n_io_events ++;
|
||||
|
||||
pa_mainloop_wakeup(m);
|
||||
|
|
@ -196,7 +196,7 @@ static void mainloop_io_enable(pa_io_event *e, pa_io_event_flags_t events) {
|
|||
if (e->pollfd)
|
||||
e->pollfd->events = map_flags_to_libc(events);
|
||||
else
|
||||
e->mainloop->rebuild_pollfds = TRUE;
|
||||
e->mainloop->rebuild_pollfds = true;
|
||||
|
||||
pa_mainloop_wakeup(e->mainloop);
|
||||
}
|
||||
|
|
@ -205,11 +205,11 @@ static void mainloop_io_free(pa_io_event *e) {
|
|||
pa_assert(e);
|
||||
pa_assert(!e->dead);
|
||||
|
||||
e->dead = TRUE;
|
||||
e->dead = true;
|
||||
e->mainloop->io_events_please_scan ++;
|
||||
|
||||
e->mainloop->n_io_events --;
|
||||
e->mainloop->rebuild_pollfds = TRUE;
|
||||
e->mainloop->rebuild_pollfds = true;
|
||||
|
||||
pa_mainloop_wakeup(e->mainloop);
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ static pa_defer_event* mainloop_defer_new(
|
|||
e = pa_xnew0(pa_defer_event, 1);
|
||||
e->mainloop = m;
|
||||
|
||||
e->enabled = TRUE;
|
||||
e->enabled = true;
|
||||
m->n_enabled_defer_events++;
|
||||
|
||||
e->callback = callback;
|
||||
|
|
@ -271,13 +271,13 @@ static void mainloop_defer_free(pa_defer_event *e) {
|
|||
pa_assert(e);
|
||||
pa_assert(!e->dead);
|
||||
|
||||
e->dead = TRUE;
|
||||
e->dead = true;
|
||||
e->mainloop->defer_events_please_scan ++;
|
||||
|
||||
if (e->enabled) {
|
||||
pa_assert(e->mainloop->n_enabled_defer_events > 0);
|
||||
e->mainloop->n_enabled_defer_events--;
|
||||
e->enabled = FALSE;
|
||||
e->enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -289,11 +289,11 @@ static void mainloop_defer_set_destroy(pa_defer_event *e, pa_defer_event_destroy
|
|||
}
|
||||
|
||||
/* Time events */
|
||||
static pa_usec_t make_rt(const struct timeval *tv, pa_bool_t *use_rtclock) {
|
||||
static pa_usec_t make_rt(const struct timeval *tv, bool *use_rtclock) {
|
||||
struct timeval ttv;
|
||||
|
||||
if (!tv) {
|
||||
*use_rtclock = FALSE;
|
||||
*use_rtclock = false;
|
||||
return PA_USEC_INVALID;
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ static pa_time_event* mainloop_time_new(
|
|||
pa_mainloop *m;
|
||||
pa_time_event *e;
|
||||
pa_usec_t t;
|
||||
pa_bool_t use_rtclock = FALSE;
|
||||
bool use_rtclock = false;
|
||||
|
||||
pa_assert(a);
|
||||
pa_assert(a->userdata);
|
||||
|
|
@ -357,9 +357,9 @@ static pa_time_event* mainloop_time_new(
|
|||
}
|
||||
|
||||
static void mainloop_time_restart(pa_time_event *e, const struct timeval *tv) {
|
||||
pa_bool_t valid;
|
||||
bool valid;
|
||||
pa_usec_t t;
|
||||
pa_bool_t use_rtclock = FALSE;
|
||||
bool use_rtclock = false;
|
||||
|
||||
pa_assert(e);
|
||||
pa_assert(!e->dead);
|
||||
|
|
@ -392,13 +392,13 @@ static void mainloop_time_free(pa_time_event *e) {
|
|||
pa_assert(e);
|
||||
pa_assert(!e->dead);
|
||||
|
||||
e->dead = TRUE;
|
||||
e->dead = true;
|
||||
e->mainloop->time_events_please_scan ++;
|
||||
|
||||
if (e->enabled) {
|
||||
pa_assert(e->mainloop->n_enabled_time_events > 0);
|
||||
e->mainloop->n_enabled_time_events--;
|
||||
e->enabled = FALSE;
|
||||
e->enabled = false;
|
||||
}
|
||||
|
||||
if (e->mainloop->cached_next_time_event == e)
|
||||
|
|
@ -464,7 +464,7 @@ pa_mainloop *pa_mainloop_new(void) {
|
|||
pa_make_fd_nonblock(m->wakeup_pipe[0]);
|
||||
pa_make_fd_nonblock(m->wakeup_pipe[1]);
|
||||
|
||||
m->rebuild_pollfds = TRUE;
|
||||
m->rebuild_pollfds = true;
|
||||
|
||||
m->api = vtable;
|
||||
m->api.userdata = m;
|
||||
|
|
@ -476,7 +476,7 @@ pa_mainloop *pa_mainloop_new(void) {
|
|||
return m;
|
||||
}
|
||||
|
||||
static void cleanup_io_events(pa_mainloop *m, pa_bool_t force) {
|
||||
static void cleanup_io_events(pa_mainloop *m, bool force) {
|
||||
pa_io_event *e, *n;
|
||||
|
||||
PA_LLIST_FOREACH_SAFE(e, n, m->io_events) {
|
||||
|
|
@ -497,14 +497,14 @@ static void cleanup_io_events(pa_mainloop *m, pa_bool_t force) {
|
|||
|
||||
pa_xfree(e);
|
||||
|
||||
m->rebuild_pollfds = TRUE;
|
||||
m->rebuild_pollfds = true;
|
||||
}
|
||||
}
|
||||
|
||||
pa_assert(m->io_events_please_scan == 0);
|
||||
}
|
||||
|
||||
static void cleanup_time_events(pa_mainloop *m, pa_bool_t force) {
|
||||
static void cleanup_time_events(pa_mainloop *m, bool force) {
|
||||
pa_time_event *e, *n;
|
||||
|
||||
PA_LLIST_FOREACH_SAFE(e, n, m->time_events) {
|
||||
|
|
@ -523,7 +523,7 @@ static void cleanup_time_events(pa_mainloop *m, pa_bool_t force) {
|
|||
if (!e->dead && e->enabled) {
|
||||
pa_assert(m->n_enabled_time_events > 0);
|
||||
m->n_enabled_time_events--;
|
||||
e->enabled = FALSE;
|
||||
e->enabled = false;
|
||||
}
|
||||
|
||||
if (e->destroy_callback)
|
||||
|
|
@ -536,7 +536,7 @@ static void cleanup_time_events(pa_mainloop *m, pa_bool_t force) {
|
|||
pa_assert(m->time_events_please_scan == 0);
|
||||
}
|
||||
|
||||
static void cleanup_defer_events(pa_mainloop *m, pa_bool_t force) {
|
||||
static void cleanup_defer_events(pa_mainloop *m, bool force) {
|
||||
pa_defer_event *e, *n;
|
||||
|
||||
PA_LLIST_FOREACH_SAFE(e, n, m->defer_events) {
|
||||
|
|
@ -555,7 +555,7 @@ static void cleanup_defer_events(pa_mainloop *m, pa_bool_t force) {
|
|||
if (!e->dead && e->enabled) {
|
||||
pa_assert(m->n_enabled_defer_events > 0);
|
||||
m->n_enabled_defer_events--;
|
||||
e->enabled = FALSE;
|
||||
e->enabled = false;
|
||||
}
|
||||
|
||||
if (e->destroy_callback)
|
||||
|
|
@ -571,9 +571,9 @@ static void cleanup_defer_events(pa_mainloop *m, pa_bool_t force) {
|
|||
void pa_mainloop_free(pa_mainloop *m) {
|
||||
pa_assert(m);
|
||||
|
||||
cleanup_io_events(m, TRUE);
|
||||
cleanup_defer_events(m, TRUE);
|
||||
cleanup_time_events(m, TRUE);
|
||||
cleanup_io_events(m, true);
|
||||
cleanup_defer_events(m, true);
|
||||
cleanup_time_events(m, true);
|
||||
|
||||
pa_xfree(m->pollfds);
|
||||
|
||||
|
|
@ -586,13 +586,13 @@ static void scan_dead(pa_mainloop *m) {
|
|||
pa_assert(m);
|
||||
|
||||
if (m->io_events_please_scan)
|
||||
cleanup_io_events(m, FALSE);
|
||||
cleanup_io_events(m, false);
|
||||
|
||||
if (m->time_events_please_scan)
|
||||
cleanup_time_events(m, FALSE);
|
||||
cleanup_time_events(m, false);
|
||||
|
||||
if (m->defer_events_please_scan)
|
||||
cleanup_defer_events(m, FALSE);
|
||||
cleanup_defer_events(m, false);
|
||||
}
|
||||
|
||||
static void rebuild_pollfds(pa_mainloop *m) {
|
||||
|
|
@ -631,7 +631,7 @@ static void rebuild_pollfds(pa_mainloop *m) {
|
|||
m->n_pollfds++;
|
||||
}
|
||||
|
||||
m->rebuild_pollfds = FALSE;
|
||||
m->rebuild_pollfds = false;
|
||||
}
|
||||
|
||||
static unsigned dispatch_pollfds(pa_mainloop *m) {
|
||||
|
|
@ -773,7 +773,7 @@ void pa_mainloop_wakeup(pa_mainloop *m) {
|
|||
/* Not much options for recovering from the error. Let's at least log something. */
|
||||
pa_log("pa_write() failed while trying to wake up the mainloop: %s", pa_cstrerror(errno));
|
||||
|
||||
pa_atomic_store(&m->wakeup_requested, TRUE);
|
||||
pa_atomic_store(&m->wakeup_requested, true);
|
||||
}
|
||||
|
||||
static void clear_wakeup(pa_mainloop *m) {
|
||||
|
|
@ -781,7 +781,7 @@ static void clear_wakeup(pa_mainloop *m) {
|
|||
|
||||
pa_assert(m);
|
||||
|
||||
if (pa_atomic_cmpxchg(&m->wakeup_requested, TRUE, FALSE)) {
|
||||
if (pa_atomic_cmpxchg(&m->wakeup_requested, true, false)) {
|
||||
while (pa_read(m->wakeup_pipe[0], &c, sizeof(c), &m->wakeup_pipe_type) == sizeof(c))
|
||||
;
|
||||
}
|
||||
|
|
@ -960,7 +960,7 @@ int pa_mainloop_run(pa_mainloop *m, int *retval) {
|
|||
void pa_mainloop_quit(pa_mainloop *m, int retval) {
|
||||
pa_assert(m);
|
||||
|
||||
m->quit = TRUE;
|
||||
m->quit = true;
|
||||
m->retval = retval;
|
||||
pa_mainloop_wakeup(m);
|
||||
}
|
||||
|
|
@ -978,7 +978,7 @@ void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *use
|
|||
m->poll_func_userdata = userdata;
|
||||
}
|
||||
|
||||
pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api *m) {
|
||||
bool pa_mainloop_is_our_api(pa_mainloop_api *m) {
|
||||
pa_assert(m);
|
||||
|
||||
return m->io_new == mainloop_io_new;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ void pa_proplist_free(pa_proplist* p) {
|
|||
/** Will accept only valid UTF-8 */
|
||||
int pa_proplist_sets(pa_proplist *p, const char *key, const char *value) {
|
||||
struct property *prop;
|
||||
pa_bool_t add = FALSE;
|
||||
bool add = false;
|
||||
|
||||
pa_assert(p);
|
||||
pa_assert(key);
|
||||
|
|
@ -88,7 +88,7 @@ int pa_proplist_sets(pa_proplist *p, const char *key, const char *value) {
|
|||
if (!(prop = pa_hashmap_get(MAKE_HASHMAP(p), key))) {
|
||||
prop = pa_xnew(struct property, 1);
|
||||
prop->key = pa_xstrdup(key);
|
||||
add = TRUE;
|
||||
add = true;
|
||||
} else
|
||||
pa_xfree(prop->value);
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ int pa_proplist_sets(pa_proplist *p, const char *key, const char *value) {
|
|||
/** Will accept only valid UTF-8 */
|
||||
static int proplist_setn(pa_proplist *p, const char *key, size_t key_length, const char *value, size_t value_length) {
|
||||
struct property *prop;
|
||||
pa_bool_t add = FALSE;
|
||||
bool add = false;
|
||||
char *k, *v;
|
||||
|
||||
pa_assert(p);
|
||||
|
|
@ -123,7 +123,7 @@ static int proplist_setn(pa_proplist *p, const char *key, size_t key_length, con
|
|||
if (!(prop = pa_hashmap_get(MAKE_HASHMAP(p), k))) {
|
||||
prop = pa_xnew(struct property, 1);
|
||||
prop->key = k;
|
||||
add = TRUE;
|
||||
add = true;
|
||||
} else {
|
||||
pa_xfree(prop->value);
|
||||
pa_xfree(k);
|
||||
|
|
@ -155,7 +155,7 @@ int pa_proplist_setp(pa_proplist *p, const char *pair) {
|
|||
|
||||
static int proplist_sethex(pa_proplist *p, const char *key, size_t key_length, const char *value, size_t value_length) {
|
||||
struct property *prop;
|
||||
pa_bool_t add = FALSE;
|
||||
bool add = false;
|
||||
char *k, *v;
|
||||
uint8_t *d;
|
||||
size_t dn;
|
||||
|
|
@ -186,7 +186,7 @@ static int proplist_sethex(pa_proplist *p, const char *key, size_t key_length, c
|
|||
if (!(prop = pa_hashmap_get(MAKE_HASHMAP(p), k))) {
|
||||
prop = pa_xnew(struct property, 1);
|
||||
prop->key = k;
|
||||
add = TRUE;
|
||||
add = true;
|
||||
} else {
|
||||
pa_xfree(prop->value);
|
||||
pa_xfree(k);
|
||||
|
|
@ -205,7 +205,7 @@ static int proplist_sethex(pa_proplist *p, const char *key, size_t key_length, c
|
|||
/** Will accept only valid UTF-8 */
|
||||
int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) {
|
||||
struct property *prop;
|
||||
pa_bool_t add = FALSE;
|
||||
bool add = false;
|
||||
va_list ap;
|
||||
char *v;
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...) {
|
|||
if (!(prop = pa_hashmap_get(MAKE_HASHMAP(p), key))) {
|
||||
prop = pa_xnew(struct property, 1);
|
||||
prop->key = pa_xstrdup(key);
|
||||
add = TRUE;
|
||||
add = true;
|
||||
} else
|
||||
pa_xfree(prop->value);
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ fail:
|
|||
|
||||
int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes) {
|
||||
struct property *prop;
|
||||
pa_bool_t add = FALSE;
|
||||
bool add = false;
|
||||
|
||||
pa_assert(p);
|
||||
pa_assert(key);
|
||||
|
|
@ -257,7 +257,7 @@ int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nb
|
|||
if (!(prop = pa_hashmap_get(MAKE_HASHMAP(p), key))) {
|
||||
prop = pa_xnew(struct property, 1);
|
||||
prop->key = pa_xstrdup(key);
|
||||
add = TRUE;
|
||||
add = true;
|
||||
} else
|
||||
pa_xfree(prop->value);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static void play_sample_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
success = 0;
|
||||
|
|
@ -147,7 +147,7 @@ static void play_sample_with_proplist_ack_callback(pa_pdispatch *pd, uint32_t co
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
idx = PA_INVALID_INDEX;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct pa_simple {
|
|||
*(rerror) = error; \
|
||||
return (ret); \
|
||||
} \
|
||||
} while(FALSE);
|
||||
} while(false);
|
||||
|
||||
#define CHECK_SUCCESS_GOTO(p, rerror, expression, label) \
|
||||
do { \
|
||||
|
|
@ -65,7 +65,7 @@ struct pa_simple {
|
|||
*(rerror) = pa_context_errno((p)->context); \
|
||||
goto label; \
|
||||
} \
|
||||
} while(FALSE);
|
||||
} while(false);
|
||||
|
||||
#define CHECK_DEAD_GOTO(p, rerror, label) \
|
||||
do { \
|
||||
|
|
@ -80,7 +80,7 @@ struct pa_simple {
|
|||
*(rerror) = PA_ERR_BADSTATE; \
|
||||
goto label; \
|
||||
} \
|
||||
} while(FALSE);
|
||||
} while(false);
|
||||
|
||||
static void context_state_cb(pa_context *c, void *userdata) {
|
||||
pa_simple *p = userdata;
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ static pa_stream *pa_stream_new_with_proplist_internal(
|
|||
pa_proplist_sets(s->proplist, PA_PROP_MEDIA_NAME, name);
|
||||
|
||||
s->channel = 0;
|
||||
s->channel_valid = FALSE;
|
||||
s->channel_valid = false;
|
||||
s->syncid = c->csyncid++;
|
||||
s->stream_index = PA_INVALID_INDEX;
|
||||
|
||||
|
|
@ -168,8 +168,8 @@ static pa_stream *pa_stream_new_with_proplist_internal(
|
|||
|
||||
s->device_index = PA_INVALID_INDEX;
|
||||
s->device_name = NULL;
|
||||
s->suspended = FALSE;
|
||||
s->corked = FALSE;
|
||||
s->suspended = false;
|
||||
s->corked = false;
|
||||
|
||||
s->write_memblock = NULL;
|
||||
s->write_data = NULL;
|
||||
|
|
@ -179,7 +179,7 @@ static pa_stream *pa_stream_new_with_proplist_internal(
|
|||
s->record_memblockq = NULL;
|
||||
|
||||
memset(&s->timing_info, 0, sizeof(s->timing_info));
|
||||
s->timing_info_valid = FALSE;
|
||||
s->timing_info_valid = false;
|
||||
|
||||
s->previous_time = 0;
|
||||
s->latest_underrun_at_index = -1;
|
||||
|
|
@ -191,7 +191,7 @@ static pa_stream *pa_stream_new_with_proplist_internal(
|
|||
s->current_write_index_correction = 0;
|
||||
|
||||
s->auto_timing_update_event = NULL;
|
||||
s->auto_timing_update_requested = FALSE;
|
||||
s->auto_timing_update_requested = false;
|
||||
s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
|
||||
|
||||
reset_callbacks(s);
|
||||
|
|
@ -262,7 +262,7 @@ static void stream_unlink(pa_stream *s) {
|
|||
if (s->channel_valid) {
|
||||
pa_hashmap_remove((s->direction == PA_STREAM_RECORD) ? s->context->record_streams : s->context->playback_streams, PA_UINT32_TO_PTR(s->channel));
|
||||
s->channel = 0;
|
||||
s->channel_valid = FALSE;
|
||||
s->channel_valid = false;
|
||||
}
|
||||
|
||||
PA_LLIST_REMOVE(pa_stream, s->context->streams, s);
|
||||
|
|
@ -376,7 +376,7 @@ void pa_stream_set_state(pa_stream *s, pa_stream_state_t st) {
|
|||
pa_stream_unref(s);
|
||||
}
|
||||
|
||||
static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
|
||||
static void request_auto_timing_update(pa_stream *s, bool force) {
|
||||
pa_assert(s);
|
||||
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||
|
||||
|
|
@ -393,7 +393,7 @@ static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
|
|||
|
||||
if ((o = pa_stream_update_timing_info(s, NULL, NULL))) {
|
||||
pa_operation_unref(o);
|
||||
s->auto_timing_update_requested = TRUE;
|
||||
s->auto_timing_update_requested = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -445,7 +445,7 @@ finish:
|
|||
pa_context_unref(c);
|
||||
}
|
||||
|
||||
static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t force_start, pa_bool_t force_stop) {
|
||||
static void check_smoother_status(pa_stream *s, bool aposteriori, bool force_start, bool force_stop) {
|
||||
pa_usec_t x;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -483,7 +483,7 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t
|
|||
return;
|
||||
}
|
||||
|
||||
pa_smoother_resume(s->smoother, x, TRUE);
|
||||
pa_smoother_resume(s->smoother, x, true);
|
||||
}
|
||||
|
||||
/* Please note that we have no idea if playback actually started
|
||||
|
|
@ -497,7 +497,7 @@ void pa_command_stream_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
|
|||
pa_stream *s;
|
||||
uint32_t channel;
|
||||
const char *dn;
|
||||
pa_bool_t suspended;
|
||||
bool suspended;
|
||||
uint32_t di;
|
||||
pa_usec_t usec = 0;
|
||||
uint32_t maxlength = 0, fragsize = 0, minreq = 0, tlength = 0, prebuf = 0;
|
||||
|
|
@ -582,11 +582,11 @@ void pa_command_stream_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
|
|||
if ((s->flags & PA_STREAM_AUTO_TIMING_UPDATE) && !suspended && !s->auto_timing_update_event) {
|
||||
s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
|
||||
s->auto_timing_update_event = pa_context_rttime_new(s->context, pa_rtclock_now() + s->auto_timing_interval_usec, &auto_timing_update_callback, s);
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
}
|
||||
|
||||
check_smoother_status(s, TRUE, FALSE, FALSE);
|
||||
request_auto_timing_update(s, TRUE);
|
||||
check_smoother_status(s, true, false, false);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (s->moved_callback)
|
||||
s->moved_callback(s, s->moved_userdata);
|
||||
|
|
@ -660,7 +660,7 @@ void pa_command_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
s->buffer_attr.prebuf = prebuf;
|
||||
s->buffer_attr.minreq = minreq;
|
||||
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (s->buffer_attr_callback)
|
||||
s->buffer_attr_callback(s, s->buffer_attr_userdata);
|
||||
|
|
@ -673,7 +673,7 @@ void pa_command_stream_suspended(pa_pdispatch *pd, uint32_t command, uint32_t ta
|
|||
pa_context *c = userdata;
|
||||
pa_stream *s;
|
||||
uint32_t channel;
|
||||
pa_bool_t suspended;
|
||||
bool suspended;
|
||||
|
||||
pa_assert(pd);
|
||||
pa_assert(command == PA_COMMAND_PLAYBACK_STREAM_SUSPENDED || command == PA_COMMAND_RECORD_STREAM_SUSPENDED);
|
||||
|
|
@ -706,11 +706,11 @@ void pa_command_stream_suspended(pa_pdispatch *pd, uint32_t command, uint32_t ta
|
|||
if ((s->flags & PA_STREAM_AUTO_TIMING_UPDATE) && !suspended && !s->auto_timing_update_event) {
|
||||
s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
|
||||
s->auto_timing_update_event = pa_context_rttime_new(s->context, pa_rtclock_now() + s->auto_timing_interval_usec, &auto_timing_update_callback, s);
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
}
|
||||
|
||||
check_smoother_status(s, TRUE, FALSE, FALSE);
|
||||
request_auto_timing_update(s, TRUE);
|
||||
check_smoother_status(s, true, false, false);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (s->suspended_callback)
|
||||
s->suspended_callback(s, s->suspended_userdata);
|
||||
|
|
@ -749,8 +749,8 @@ void pa_command_stream_started(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|
|||
if (s->state != PA_STREAM_READY)
|
||||
goto finish;
|
||||
|
||||
check_smoother_status(s, TRUE, TRUE, FALSE);
|
||||
request_auto_timing_update(s, TRUE);
|
||||
check_smoother_status(s, true, true, false);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (s->started_callback)
|
||||
s->started_callback(s, s->started_userdata);
|
||||
|
|
@ -897,9 +897,9 @@ void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, uint32
|
|||
s->latest_underrun_at_index = offset;
|
||||
|
||||
if (s->buffer_attr.prebuf > 0)
|
||||
check_smoother_status(s, TRUE, FALSE, TRUE);
|
||||
check_smoother_status(s, true, false, true);
|
||||
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (command == PA_COMMAND_OVERFLOW) {
|
||||
if (s->overflow_callback)
|
||||
|
|
@ -913,7 +913,7 @@ finish:
|
|||
pa_context_unref(c);
|
||||
}
|
||||
|
||||
static void invalidate_indexes(pa_stream *s, pa_bool_t r, pa_bool_t w) {
|
||||
static void invalidate_indexes(pa_stream *s, bool r, bool w) {
|
||||
pa_assert(s);
|
||||
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||
|
||||
|
|
@ -928,7 +928,7 @@ static void invalidate_indexes(pa_stream *s, pa_bool_t r, pa_bool_t w) {
|
|||
s->write_index_not_before = s->context->ctag;
|
||||
|
||||
if (s->timing_info_valid)
|
||||
s->timing_info.write_index_corrupt = TRUE;
|
||||
s->timing_info.write_index_corrupt = true;
|
||||
|
||||
#ifdef STREAM_DEBUG
|
||||
pa_log_debug("write_index invalidated");
|
||||
|
|
@ -939,14 +939,14 @@ static void invalidate_indexes(pa_stream *s, pa_bool_t r, pa_bool_t w) {
|
|||
s->read_index_not_before = s->context->ctag;
|
||||
|
||||
if (s->timing_info_valid)
|
||||
s->timing_info.read_index_corrupt = TRUE;
|
||||
s->timing_info.read_index_corrupt = true;
|
||||
|
||||
#ifdef STREAM_DEBUG
|
||||
pa_log_debug("read_index invalidated");
|
||||
#endif
|
||||
}
|
||||
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
}
|
||||
|
||||
static void auto_timing_update_callback(pa_mainloop_api *m, pa_time_event *e, const struct timeval *t, void *userdata) {
|
||||
|
|
@ -956,7 +956,7 @@ static void auto_timing_update_callback(pa_mainloop_api *m, pa_time_event *e, co
|
|||
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||
|
||||
pa_stream_ref(s);
|
||||
request_auto_timing_update(s, FALSE);
|
||||
request_auto_timing_update(s, false);
|
||||
pa_stream_unref(s);
|
||||
}
|
||||
|
||||
|
|
@ -975,10 +975,10 @@ static void create_stream_complete(pa_stream *s) {
|
|||
pa_assert(!s->auto_timing_update_event);
|
||||
s->auto_timing_update_event = pa_context_rttime_new(s->context, pa_rtclock_now() + s->auto_timing_interval_usec, &auto_timing_update_callback, s);
|
||||
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
}
|
||||
|
||||
check_smoother_status(s, TRUE, FALSE, FALSE);
|
||||
check_smoother_status(s, true, false, false);
|
||||
}
|
||||
|
||||
static void patch_buffer_attr(pa_stream *s, pa_buffer_attr *attr, pa_stream_flags_t *flags) {
|
||||
|
|
@ -1041,7 +1041,7 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|
|||
pa_stream_ref(s);
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(s->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(s->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
pa_stream_set_state(s, PA_STREAM_FAILED);
|
||||
|
|
@ -1080,7 +1080,7 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|
|||
pa_sample_spec ss;
|
||||
pa_channel_map cm;
|
||||
const char *dn = NULL;
|
||||
pa_bool_t suspended;
|
||||
bool suspended;
|
||||
|
||||
if (pa_tagstruct_get_sample_spec(t, &ss) < 0 ||
|
||||
pa_tagstruct_get_channel_map(t, &cm) < 0 ||
|
||||
|
|
@ -1163,7 +1163,7 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|
|||
NULL);
|
||||
}
|
||||
|
||||
s->channel_valid = TRUE;
|
||||
s->channel_valid = true;
|
||||
pa_hashmap_put((s->direction == PA_STREAM_RECORD) ? s->context->record_streams : s->context->playback_streams, PA_UINT32_TO_PTR(s->channel), s);
|
||||
|
||||
create_stream_complete(s);
|
||||
|
|
@ -1183,7 +1183,7 @@ static int create_stream(
|
|||
|
||||
pa_tagstruct *t;
|
||||
uint32_t tag;
|
||||
pa_bool_t volume_set = !!volume;
|
||||
bool volume_set = !!volume;
|
||||
pa_cvolume cv;
|
||||
uint32_t i;
|
||||
|
||||
|
|
@ -1252,10 +1252,10 @@ static int create_stream(
|
|||
SMOOTHER_ADJUST_TIME,
|
||||
SMOOTHER_HISTORY_TIME,
|
||||
!(flags & PA_STREAM_NOT_MONOTONIC),
|
||||
TRUE,
|
||||
true,
|
||||
SMOOTHER_MIN_HISTORY,
|
||||
x,
|
||||
TRUE);
|
||||
true);
|
||||
}
|
||||
|
||||
if (!dev)
|
||||
|
|
@ -1562,31 +1562,31 @@ int pa_stream_write(
|
|||
if (s->write_index_corrections[s->current_write_index_correction].valid) {
|
||||
|
||||
if (seek == PA_SEEK_ABSOLUTE) {
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = FALSE;
|
||||
s->write_index_corrections[s->current_write_index_correction].absolute = TRUE;
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = false;
|
||||
s->write_index_corrections[s->current_write_index_correction].absolute = true;
|
||||
s->write_index_corrections[s->current_write_index_correction].value = offset + (int64_t) length;
|
||||
} else if (seek == PA_SEEK_RELATIVE) {
|
||||
if (!s->write_index_corrections[s->current_write_index_correction].corrupt)
|
||||
s->write_index_corrections[s->current_write_index_correction].value += offset + (int64_t) length;
|
||||
} else
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = TRUE;
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = true;
|
||||
}
|
||||
|
||||
/* Update the write index in the already available latency data */
|
||||
if (s->timing_info_valid) {
|
||||
|
||||
if (seek == PA_SEEK_ABSOLUTE) {
|
||||
s->timing_info.write_index_corrupt = FALSE;
|
||||
s->timing_info.write_index_corrupt = false;
|
||||
s->timing_info.write_index = offset + (int64_t) length;
|
||||
} else if (seek == PA_SEEK_RELATIVE) {
|
||||
if (!s->timing_info.write_index_corrupt)
|
||||
s->timing_info.write_index += offset + (int64_t) length;
|
||||
} else
|
||||
s->timing_info.write_index_corrupt = TRUE;
|
||||
s->timing_info.write_index_corrupt = true;
|
||||
}
|
||||
|
||||
if (!s->timing_info_valid || s->timing_info.write_index_corrupt)
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1691,7 +1691,7 @@ pa_operation * pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
|||
/* Ask for a timing update before we cork/uncork to get the best
|
||||
* accuracy for the transport latency suitable for the
|
||||
* check_smoother_status() call in the started callback */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
o = pa_operation_new(s->context, s, (pa_operation_cb_t) cb, userdata);
|
||||
|
||||
|
|
@ -1702,12 +1702,12 @@ pa_operation * pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
|||
|
||||
/* This might cause the read index to continue again, hence
|
||||
* let's request a timing update */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
static pa_usec_t calc_time(pa_stream *s, pa_bool_t ignore_transport) {
|
||||
static pa_usec_t calc_time(pa_stream *s, bool ignore_transport) {
|
||||
pa_usec_t usec;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -1772,7 +1772,7 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
pa_operation *o = userdata;
|
||||
struct timeval local, remote, now;
|
||||
pa_timing_info *i;
|
||||
pa_bool_t playing = FALSE;
|
||||
bool playing = false;
|
||||
uint64_t underrun_for = 0, playing_for = 0;
|
||||
|
||||
pa_assert(pd);
|
||||
|
|
@ -1784,12 +1784,12 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
i = &o->stream->timing_info;
|
||||
|
||||
o->stream->timing_info_valid = FALSE;
|
||||
i->write_index_corrupt = TRUE;
|
||||
i->read_index_corrupt = TRUE;
|
||||
o->stream->timing_info_valid = false;
|
||||
i->write_index_corrupt = true;
|
||||
i->read_index_corrupt = true;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
} else {
|
||||
|
|
@ -1819,9 +1819,9 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
goto finish;
|
||||
}
|
||||
o->stream->timing_info_valid = TRUE;
|
||||
i->write_index_corrupt = FALSE;
|
||||
i->read_index_corrupt = FALSE;
|
||||
o->stream->timing_info_valid = true;
|
||||
i->write_index_corrupt = false;
|
||||
i->read_index_corrupt = false;
|
||||
|
||||
i->playing = (int) playing;
|
||||
i->since_underrun = (int64_t) (playing ? playing_for : underrun_for);
|
||||
|
|
@ -1837,22 +1837,22 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
else
|
||||
i->transport_usec = pa_timeval_diff(&now, &remote);
|
||||
|
||||
i->synchronized_clocks = TRUE;
|
||||
i->synchronized_clocks = true;
|
||||
i->timestamp = remote;
|
||||
} else {
|
||||
/* clocks are not synchronized, let's estimate latency then */
|
||||
i->transport_usec = pa_timeval_diff(&now, &local)/2;
|
||||
i->synchronized_clocks = FALSE;
|
||||
i->synchronized_clocks = false;
|
||||
i->timestamp = local;
|
||||
pa_timeval_add(&i->timestamp, i->transport_usec);
|
||||
}
|
||||
|
||||
/* Invalidate read and write indexes if necessary */
|
||||
if (tag < o->stream->read_index_not_before)
|
||||
i->read_index_corrupt = TRUE;
|
||||
i->read_index_corrupt = true;
|
||||
|
||||
if (tag < o->stream->write_index_not_before)
|
||||
i->write_index_corrupt = TRUE;
|
||||
i->write_index_corrupt = true;
|
||||
|
||||
if (o->stream->direction == PA_STREAM_PLAYBACK) {
|
||||
/* Write index correction */
|
||||
|
|
@ -1877,11 +1877,11 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
/* Now fix the write index */
|
||||
if (o->stream->write_index_corrections[j].corrupt) {
|
||||
/* A corrupting seek was made */
|
||||
i->write_index_corrupt = TRUE;
|
||||
i->write_index_corrupt = true;
|
||||
} else if (o->stream->write_index_corrections[j].absolute) {
|
||||
/* An absolute seek was made */
|
||||
i->write_index = o->stream->write_index_corrections[j].value;
|
||||
i->write_index_corrupt = FALSE;
|
||||
i->write_index_corrupt = false;
|
||||
} else if (!i->write_index_corrupt) {
|
||||
/* A relative seek was made */
|
||||
i->write_index += o->stream->write_index_corrections[j].value;
|
||||
|
|
@ -1894,7 +1894,7 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
continue;
|
||||
|
||||
if (o->stream->write_index_corrections[n].tag <= tag)
|
||||
o->stream->write_index_corrections[n].valid = FALSE;
|
||||
o->stream->write_index_corrections[n].valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1931,14 +1931,14 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
/* Update the smoother */
|
||||
if ((o->stream->direction == PA_STREAM_PLAYBACK && !i->read_index_corrupt) ||
|
||||
(o->stream->direction == PA_STREAM_RECORD && !i->write_index_corrupt))
|
||||
pa_smoother_put(o->stream->smoother, u, calc_time(o->stream, TRUE));
|
||||
pa_smoother_put(o->stream->smoother, u, calc_time(o->stream, true));
|
||||
|
||||
if (i->playing)
|
||||
pa_smoother_resume(o->stream->smoother, x, TRUE);
|
||||
pa_smoother_resume(o->stream->smoother, x, true);
|
||||
}
|
||||
}
|
||||
|
||||
o->stream->auto_timing_update_requested = FALSE;
|
||||
o->stream->auto_timing_update_requested = false;
|
||||
|
||||
if (o->stream->latency_update_callback)
|
||||
o->stream->latency_update_callback(o->stream, o->stream->latency_update_userdata);
|
||||
|
|
@ -1992,9 +1992,9 @@ pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t
|
|||
|
||||
s->current_write_index_correction = cidx;
|
||||
|
||||
s->write_index_corrections[cidx].valid = TRUE;
|
||||
s->write_index_corrections[cidx].absolute = FALSE;
|
||||
s->write_index_corrections[cidx].corrupt = FALSE;
|
||||
s->write_index_corrections[cidx].valid = true;
|
||||
s->write_index_corrections[cidx].absolute = false;
|
||||
s->write_index_corrections[cidx].corrupt = false;
|
||||
s->write_index_corrections[cidx].tag = tag;
|
||||
s->write_index_corrections[cidx].value = 0;
|
||||
}
|
||||
|
|
@ -2012,7 +2012,7 @@ void pa_stream_disconnect_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
pa_stream_ref(s);
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(s->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(s->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
pa_stream_set_state(s, PA_STREAM_FAILED);
|
||||
|
|
@ -2220,7 +2220,7 @@ void pa_stream_simple_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_t
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
success = 0;
|
||||
|
|
@ -2254,7 +2254,7 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
|
|||
/* Ask for a timing update before we cork/uncork to get the best
|
||||
* accuracy for the transport latency suitable for the
|
||||
* check_smoother_status() call in the started callback */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
s->corked = b;
|
||||
|
||||
|
|
@ -2269,11 +2269,11 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
|
|||
pa_pstream_send_tagstruct(s->context->pstream, t);
|
||||
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_stream_simple_ack_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);
|
||||
|
||||
check_smoother_status(s, FALSE, FALSE, FALSE);
|
||||
check_smoother_status(s, false, false, false);
|
||||
|
||||
/* This might cause the indexes to hang/start again, hence let's
|
||||
* request a timing update, after the cork/uncork, too */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
@ -2312,7 +2312,7 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
|
|||
/* Ask for a timing update *before* the flush, so that the
|
||||
* transport usec is as up to date as possible when we get the
|
||||
* underflow message and update the smoother status*/
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (!(o = stream_send_simple_command(s, (uint32_t) (s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM), cb, userdata)))
|
||||
return NULL;
|
||||
|
|
@ -2320,19 +2320,19 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
|
|||
if (s->direction == PA_STREAM_PLAYBACK) {
|
||||
|
||||
if (s->write_index_corrections[s->current_write_index_correction].valid)
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = TRUE;
|
||||
s->write_index_corrections[s->current_write_index_correction].corrupt = true;
|
||||
|
||||
if (s->buffer_attr.prebuf > 0)
|
||||
check_smoother_status(s, FALSE, FALSE, TRUE);
|
||||
check_smoother_status(s, false, false, true);
|
||||
|
||||
/* This will change the write index, but leave the
|
||||
* read index untouched. */
|
||||
invalidate_indexes(s, FALSE, TRUE);
|
||||
invalidate_indexes(s, false, true);
|
||||
|
||||
} else
|
||||
/* For record streams this has no influence on the write
|
||||
* index, but the read index might jump. */
|
||||
invalidate_indexes(s, TRUE, FALSE);
|
||||
invalidate_indexes(s, true, false);
|
||||
|
||||
/* Note that we do not update requested_bytes here. This is
|
||||
* because we cannot really know how data actually was dropped
|
||||
|
|
@ -2356,14 +2356,14 @@ pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
|||
/* Ask for a timing update before we cork/uncork to get the best
|
||||
* accuracy for the transport latency suitable for the
|
||||
* check_smoother_status() call in the started callback */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (!(o = stream_send_simple_command(s, PA_COMMAND_PREBUF_PLAYBACK_STREAM, cb, userdata)))
|
||||
return NULL;
|
||||
|
||||
/* This might cause the read index to hang again, hence
|
||||
* let's request a timing update */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
@ -2382,14 +2382,14 @@ pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *u
|
|||
/* Ask for a timing update before we cork/uncork to get the best
|
||||
* accuracy for the transport latency suitable for the
|
||||
* check_smoother_status() call in the started callback */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
if (!(o = stream_send_simple_command(s, PA_COMMAND_TRIGGER_PLAYBACK_STREAM, cb, userdata)))
|
||||
return NULL;
|
||||
|
||||
/* This might cause the read index to start moving again, hence
|
||||
* let's request a timing update */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
@ -2445,7 +2445,7 @@ int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) {
|
|||
if (s->smoother)
|
||||
usec = pa_smoother_get(s->smoother, pa_rtclock_now());
|
||||
else
|
||||
usec = calc_time(s, FALSE);
|
||||
usec = calc_time(s, false);
|
||||
|
||||
/* Make sure the time runs monotonically */
|
||||
if (!(s->flags & PA_STREAM_NOT_MONOTONIC)) {
|
||||
|
|
@ -2579,7 +2579,7 @@ static void stream_set_buffer_attr_callback(pa_pdispatch *pd, uint32_t command,
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
success = 0;
|
||||
|
|
@ -2648,7 +2648,7 @@ pa_operation* pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr
|
|||
/* Ask for a timing update before we cork/uncork to get the best
|
||||
* accuracy for the transport latency suitable for the
|
||||
* check_smoother_status() call in the started callback */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
o = pa_operation_new(s->context, s, (pa_operation_cb_t) cb, userdata);
|
||||
|
||||
|
|
@ -2685,7 +2685,7 @@ pa_operation* pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr
|
|||
|
||||
/* This might cause changes in the read/write index, hence let's
|
||||
* request a timing update */
|
||||
request_auto_timing_update(s, TRUE);
|
||||
request_auto_timing_update(s, true);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
@ -2751,7 +2751,7 @@ static void stream_update_sample_rate_callback(pa_pdispatch *pd, uint32_t comman
|
|||
goto finish;
|
||||
|
||||
if (command != PA_COMMAND_REPLY) {
|
||||
if (pa_context_handle_error(o->context, command, t, FALSE) < 0)
|
||||
if (pa_context_handle_error(o->context, command, t, false) < 0)
|
||||
goto finish;
|
||||
|
||||
success = 0;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ pa_threaded_mainloop *pa_threaded_mainloop_new(void) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
m->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
m->mutex = pa_mutex_new(true, true);
|
||||
m->cond = pa_cond_new();
|
||||
m->accept_cond = pa_cond_new();
|
||||
m->thread = NULL;
|
||||
|
|
|
|||
|
|
@ -64,24 +64,24 @@
|
|||
|
||||
#define FILTER_CHAR '_'
|
||||
|
||||
static inline pa_bool_t is_unicode_valid(uint32_t ch) {
|
||||
static inline bool is_unicode_valid(uint32_t ch) {
|
||||
|
||||
if (ch >= 0x110000) /* End of unicode space */
|
||||
return FALSE;
|
||||
return false;
|
||||
if ((ch & 0xFFFFF800) == 0xD800) /* Reserved area for UTF-16 */
|
||||
return FALSE;
|
||||
return false;
|
||||
if ((ch >= 0xFDD0) && (ch <= 0xFDEF)) /* Reserved */
|
||||
return FALSE;
|
||||
return false;
|
||||
if ((ch & 0xFFFE) == 0xFFFE) /* BOM (Byte Order Mark) */
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline pa_bool_t is_continuation_char(uint8_t ch) {
|
||||
static inline bool is_continuation_char(uint8_t ch) {
|
||||
if ((ch & 0xc0) != 0x80) /* 10xxxxxx */
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void merge_continuation_char(uint32_t *u_ch, uint8_t ch) {
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ double pa_sw_volume_to_linear(pa_volume_t v) {
|
|||
|
||||
char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
|
||||
unsigned channel;
|
||||
pa_bool_t first = TRUE;
|
||||
bool first = true;
|
||||
char *e;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -307,7 +307,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
|
|||
(c->values[channel]*100+PA_VOLUME_NORM/2)/PA_VOLUME_NORM);
|
||||
|
||||
e = strchr(e, 0);
|
||||
first = FALSE;
|
||||
first = false;
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
@ -330,7 +330,7 @@ char *pa_volume_snprint(char *s, size_t l, pa_volume_t v) {
|
|||
|
||||
char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
|
||||
unsigned channel;
|
||||
pa_bool_t first = TRUE;
|
||||
bool first = true;
|
||||
char *e;
|
||||
|
||||
pa_assert(s);
|
||||
|
|
@ -355,7 +355,7 @@ char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
|
|||
isinf(f) < 0 || f <= PA_DECIBEL_MININFTY ? -INFINITY : f);
|
||||
|
||||
e = strchr(e, 0);
|
||||
first = FALSE;
|
||||
first = false;
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
@ -479,27 +479,27 @@ int pa_cvolume_valid(const pa_cvolume *v) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static pa_bool_t on_left(pa_channel_position_t p) {
|
||||
static bool on_left(pa_channel_position_t p) {
|
||||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_LEFT);
|
||||
}
|
||||
|
||||
static pa_bool_t on_right(pa_channel_position_t p) {
|
||||
static bool on_right(pa_channel_position_t p) {
|
||||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_RIGHT);
|
||||
}
|
||||
|
||||
static pa_bool_t on_center(pa_channel_position_t p) {
|
||||
static bool on_center(pa_channel_position_t p) {
|
||||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_CENTER);
|
||||
}
|
||||
|
||||
static pa_bool_t on_lfe(pa_channel_position_t p) {
|
||||
static bool on_lfe(pa_channel_position_t p) {
|
||||
return p == PA_CHANNEL_POSITION_LFE;
|
||||
}
|
||||
|
||||
static pa_bool_t on_front(pa_channel_position_t p) {
|
||||
static bool on_front(pa_channel_position_t p) {
|
||||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_FRONT);
|
||||
}
|
||||
|
||||
static pa_bool_t on_rear(pa_channel_position_t p) {
|
||||
static bool on_rear(pa_channel_position_t p) {
|
||||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_REAR);
|
||||
}
|
||||
|
||||
|
|
@ -828,7 +828,7 @@ pa_cvolume* pa_cvolume_set_position(
|
|||
pa_volume_t v) {
|
||||
|
||||
unsigned c;
|
||||
pa_bool_t good = FALSE;
|
||||
bool good = false;
|
||||
|
||||
pa_assert(cv);
|
||||
pa_assert(map);
|
||||
|
|
@ -840,7 +840,7 @@ pa_cvolume* pa_cvolume_set_position(
|
|||
for (c = 0; c < map->channels; c++)
|
||||
if (map->map[c] == t) {
|
||||
cv->values[c] = v;
|
||||
good = TRUE;
|
||||
good = true;
|
||||
}
|
||||
|
||||
return good ? cv : NULL;
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ pa_volume_t pa_cvolume_min(const pa_cvolume *a) PA_GCC_PURE;
|
|||
* \since 0.9.16 */
|
||||
pa_volume_t pa_cvolume_min_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) PA_GCC_PURE;
|
||||
|
||||
/** Return TRUE when the passed cvolume structure is valid, FALSE otherwise */
|
||||
/** Return true when the passed cvolume structure is valid, false otherwise */
|
||||
int pa_cvolume_valid(const pa_cvolume *v) PA_GCC_PURE;
|
||||
|
||||
/** Return non-zero if the volume of all channels is equal to the specified value */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue