diff options
Diffstat (limited to 'src/pulse')
56 files changed, 221 insertions, 267 deletions
diff --git a/src/pulse/.gitignore b/src/pulse/.gitignore new file mode 100644 index 00000000..67020331 --- /dev/null +++ b/src/pulse/.gitignore @@ -0,0 +1 @@ +version.h diff --git a/src/pulse/browser.c b/src/pulse/browser.c index 5e4aa87b..1a3f657f 100644 --- a/src/pulse/browser.c +++ b/src/pulse/browser.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/browser.h b/src/pulse/browser.h index b039ca33..c4e0a17e 100644 --- a/src/pulse/browser.h +++ b/src/pulse/browser.h @@ -1,8 +1,6 @@ #ifndef foobrowserhfoo #define foobrowserhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/cdecl.h b/src/pulse/cdecl.h index 922ad276..8c5b2d0f 100644 --- a/src/pulse/cdecl.h +++ b/src/pulse/cdecl.h @@ -1,8 +1,6 @@ #ifndef foopulsecdeclhfoo #define foopulsecdeclhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c index 2b35ee75..7348b32e 100644 --- a/src/pulse/channelmap.c +++ b/src/pulse/channelmap.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -396,6 +394,34 @@ pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, p } } +pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def) { + unsigned c; + + pa_assert(m); + pa_assert(channels > 0); + pa_assert(channels <= PA_CHANNELS_MAX); + + pa_channel_map_init(m); + + for (c = channels; c > 0; c--) { + + if (pa_channel_map_init_auto(m, c, def)) { + unsigned i = 0; + + for (; c < channels; c++) { + + m->map[c] = PA_CHANNEL_POSITION_AUX0 + i; + i++; + } + + m->channels = channels; + + return m; + } + } + + return NULL; +} const char* pa_channel_position_to_string(pa_channel_position_t pos) { diff --git a/src/pulse/channelmap.h b/src/pulse/channelmap.h index 00d3eb0d..2551eae9 100644 --- a/src/pulse/channelmap.h +++ b/src/pulse/channelmap.h @@ -1,8 +1,6 @@ #ifndef foochannelmaphfoo #define foochannelmaphfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -168,10 +166,18 @@ pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m); /** Initialize the specified channel map for stereophonic audio and return a pointer to it */ pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m); -/** Initialize the specified channel map for the specified number - * of channels using default labels and return a pointer to it. */ +/** Initialize the specified channel map for the specified number of + * channels using default labels and return a pointer to it. This call + * will fail (return NULL) if there is no default channel map known for this + * specific number of channels and mapping. */ pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def); +/** Similar to pa_channel_map_init_auto() but instead of failing if no + * default mapping is known with the specified parameters it will + * synthesize a mapping based on a known mapping with fewer channels + * and fill up the rest with AUX0...AUX31 channels \since 0.9.11 */ +pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def); + /** Return a text label for the specified channel position */ const char* pa_channel_position_to_string(pa_channel_position_t pos) PA_GCC_PURE; diff --git a/src/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c index 49df4b6c..393a7cd3 100644 --- a/src/pulse/client-conf-x11.c +++ b/src/pulse/client-conf-x11.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/client-conf-x11.h b/src/pulse/client-conf-x11.h index 56cd406d..f2f40e03 100644 --- a/src/pulse/client-conf-x11.h +++ b/src/pulse/client-conf-x11.h @@ -1,8 +1,6 @@ #ifndef fooclientconfx11hfoo #define fooclientconfx11hfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c index 75f44182..2ead871f 100644 --- a/src/pulse/client-conf.c +++ b/src/pulse/client-conf.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -58,7 +56,7 @@ static const pa_client_conf default_conf = { .default_sink = NULL, .default_source = NULL, .default_server = NULL, - .autospawn = FALSE, + .autospawn = TRUE, .disable_shm = FALSE, .cookie_file = NULL, .cookie_valid = FALSE, @@ -178,11 +176,11 @@ int pa_client_conf_env(pa_client_conf *c) { int pa_client_conf_load_cookie(pa_client_conf* c) { pa_assert(c); - c->cookie_valid = FALSE; - if (!c->cookie_file) return -1; + c->cookie_valid = FALSE; + if (pa_authkey_load_auto(c->cookie_file, c->cookie, sizeof(c->cookie)) < 0) return -1; diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h index 7cc975e6..699279aa 100644 --- a/src/pulse/client-conf.h +++ b/src/pulse/client-conf.h @@ -1,8 +1,6 @@ #ifndef fooclientconfhfoo #define fooclientconfhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in index 2bc8a7c8..749e9688 100644 --- a/src/pulse/client.conf.in +++ b/src/pulse/client.conf.in @@ -1,5 +1,3 @@ -# $Id$ -# # This file is part of PulseAudio. # # PulseAudio is free software; you can redistribute it and/or modify @@ -25,7 +23,7 @@ ; default-source = ; default-server = -; autospawn = no +; autospawn = yes ; daemon-binary = @PA_BINARY@ ; extra-arguments = --log-target=syslog --exit-idle-time=5 diff --git a/src/pulse/context.c b/src/pulse/context.c index f9f021af..f56cb241 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -70,6 +68,7 @@ #include <pulsecore/socket-util.h> #include <pulsecore/creds.h> #include <pulsecore/macro.h> +#include <pulsecore/proplist-util.h> #include "internal.h" @@ -103,7 +102,9 @@ static void unlock_autospawn_lock_file(pa_context *c) { if (c->autospawn_lock_fd >= 0) { char *lf; - lf = pa_runtime_path(AUTOSPAWN_LOCK); + if (!(lf = pa_runtime_path(AUTOSPAWN_LOCK))) + pa_log_warn("Cannot unlock autospawn because runtime path is no more."); + pa_unlock_lockfile(lf, c->autospawn_lock_fd); pa_xfree(lf); @@ -167,6 +168,7 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char * c->autospawn_lock_fd = -1; memset(&c->spawn_api, 0, sizeof(c->spawn_api)); c->do_autospawn = FALSE; + c->do_shm = FALSE; #ifndef MSG_NOSIGNAL #ifdef SIGPIPE @@ -175,10 +177,10 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char * #endif c->conf = pa_client_conf_new(); - pa_client_conf_load(c->conf, NULL); #ifdef HAVE_X11 pa_client_conf_from_x11(c->conf, NULL); #endif + pa_client_conf_load(c->conf, NULL); pa_client_conf_env(c->conf); if (!(c->mempool = pa_mempool_new(!c->conf->disable_shm))) { @@ -422,6 +424,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t switch(c->state) { case PA_CONTEXT_AUTHORIZING: { pa_tagstruct *reply; + pa_bool_t shm_on_remote; if (pa_tagstruct_getu32(t, &c->version) < 0 || !pa_tagstruct_eof(t)) { @@ -435,10 +438,22 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t goto finish; } + /* Starting with protocol version 13 the MSB of the version + tag reflects if shm is available for this connection or + not. */ + if (c->version >= 13) { + shm_on_remote = !!(c->version & 0x80000000U); + c->version &= 0x7FFFFFFFU; + } + + pa_log_debug("Protocol version: remote %u, local %u", c->version, PA_PROTOCOL_VERSION); + /* Enable shared memory support if possible */ - if (c->version >= 10 && - pa_mempool_is_shared(c->mempool) && - c->is_local) { + if (c->do_shm) + if (c->version < 10 || (c->version >= 13 && !shm_on_remote)) + c->do_shm = FALSE; + + if (c->do_shm) { /* Only enable SHM if both sides are owned by the same * user. This is a security measure because otherwise @@ -446,12 +461,14 @@ 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))) - if (getuid() == creds->uid) - pa_pstream_enable_shm(c->pstream, TRUE); + if (!(creds = pa_pdispatch_creds(pd)) || getuid() != creds->uid) + c->do_shm = FALSE; #endif } + pa_log_debug("Negotiated SHM: %s", pa_yes_no(c->do_shm)); + pa_pstream_enable_shm(c->pstream, c->do_shm); + reply = pa_tagstruct_command(c, PA_COMMAND_SET_CLIENT_NAME, &tag); if (c->version >= 13) { @@ -510,7 +527,16 @@ static void setup_context(pa_context *c, pa_iochannel *io) { pa_log_info("No cookie loaded. Attempting to connect without."); t = pa_tagstruct_command(c, PA_COMMAND_AUTH, &tag); - pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION); + + c->do_shm = + pa_mempool_is_shared(c->mempool) && + c->is_local; + + pa_log_debug("SHM possible: %s", pa_yes_no(c->do_shm)); + + /* Starting with protocol version 13 we use the MSB of the version + * tag for informing the other side if we could do SHM or not */ + pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION | (c->do_shm ? 0x80000000U : 0)); pa_tagstruct_put_arbitrary(t, c->conf->cookie, sizeof(c->conf->cookie)); #ifdef HAVE_CREDS @@ -621,6 +647,7 @@ static int context_connect_spawn(pa_context *c) { /* Parent */ pa_assert_se(pa_close(fds[1]) == 0); + fds[1] = -1; r = waitpid(pid, &status, 0); @@ -749,11 +776,15 @@ static char *get_legacy_runtime_dir(void) { p = pa_sprintf_malloc("/tmp/pulse-%s", u); - if (stat(p, &st) < 0) + if (stat(p, &st) < 0) { + pa_xfree(p); return NULL; + } - if (st.st_uid != getuid()) + if (st.st_uid != getuid()) { + pa_xfree(p); return NULL; + } return p; } @@ -809,7 +840,7 @@ int pa_context_connect( /* The system wide instance */ c->server_list = pa_strlist_prepend(c->server_list, PA_SYSTEM_RUNTIME_PATH PA_PATH_SEP PA_NATIVE_DEFAULT_UNIX_SOCKET); - /* The old per-user instance path. This is supported only to easy upgrades */ + /* The old per-user instance path. This is supported only to ease upgrades */ if ((legacy_dir = get_legacy_runtime_dir())) { char *p = pa_sprintf_malloc("%s" PA_PATH_SEP PA_NATIVE_DEFAULT_UNIX_SOCKET, legacy_dir); c->server_list = pa_strlist_prepend(c->server_list, p); @@ -818,14 +849,20 @@ int pa_context_connect( } /* The per-user instance */ - c->server_list = pa_strlist_prepend(c->server_list, ufn = pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET)); - pa_xfree(ufn); + if ((ufn = pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET))) { + c->server_list = pa_strlist_prepend(c->server_list, ufn); + pa_xfree(ufn); + } /* Wrap the connection attempts in a single transaction for sane autospawn locking */ if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) { char *lf; - lf = pa_runtime_path(AUTOSPAWN_LOCK); + if (!(lf = pa_runtime_path(AUTOSPAWN_LOCK))) { + pa_context_fail(c, PA_ERR_ACCESS); + goto finish; + } + pa_assert(c->autospawn_lock_fd <= 0); c->autospawn_lock_fd = pa_lock_lockfile(lf); pa_xfree(lf); @@ -1193,85 +1230,3 @@ pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[] return o; } - -void pa_init_proplist(pa_proplist *p) { - int a, b; -#ifndef HAVE_DECL_ENVIRON - extern char **environ; -#endif - char **e; - - pa_assert(p); - - for (e = environ; *e; e++) { - - if (pa_startswith(*e, "PULSE_PROP_")) { - size_t kl = strcspn(*e+11, "="); - char *k; - - if ((*e)[11+kl] != '=') - continue; - - if (!pa_utf8_valid(*e+11+kl+1)) - continue; - - k = pa_xstrndup(*e+11, kl); - - if (pa_proplist_contains(p, k)) { - pa_xfree(k); - continue; - } - - pa_proplist_sets(p, k, *e+11+kl+1); - pa_xfree(k); - } - } - - if (!pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_ID)) { - char t[32]; - pa_snprintf(t, sizeof(t), "%lu", (unsigned long) getpid()); - pa_proplist_sets(p, PA_PROP_APPLICATION_PROCESS_ID, t); - } - - if (!pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_USER)) { - char t[64]; - if (pa_get_user_name(t, sizeof(t))) { - char *c = pa_utf8_filter(t); - pa_proplist_sets(p, PA_PROP_APPLICATION_PROCESS_USER, c); - pa_xfree(c); - } - } - - if (!pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_HOST)) { - char t[64]; - if (pa_get_host_name(t, sizeof(t))) { - char *c = pa_utf8_filter(t); - pa_proplist_sets(p, PA_PROP_APPLICATION_PROCESS_HOST, c); - pa_xfree(c); - } - } - - a = pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_BINARY); - b = pa_proplist_contains(p, PA_PROP_APPLICATION_NAME); - - if (!a || !b) { - char t[PATH_MAX]; - if (pa_get_binary_name(t, sizeof(t))) { - char *c = pa_utf8_filter(t); - - if (!a) - pa_proplist_sets(p, PA_PROP_APPLICATION_PROCESS_BINARY, c); - if (!b) - pa_proplist_sets(p, PA_PROP_APPLICATION_NAME, c); - - pa_xfree(c); - } - } - - if (!pa_proplist_contains(p, PA_PROP_APPLICATION_LANGUAGE)) { - const char *l; - - if ((l = setlocale(LC_MESSAGES, NULL))) - pa_proplist_sets(p, PA_PROP_APPLICATION_LANGUAGE, l); - } -} diff --git a/src/pulse/context.h b/src/pulse/context.h index 143508f4..8dff7642 100644 --- a/src/pulse/context.h +++ b/src/pulse/context.h @@ -1,8 +1,6 @@ #ifndef foocontexthfoo #define foocontexthfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/def.h b/src/pulse/def.h index 10722329..a91c1031 100644 --- a/src/pulse/def.h +++ b/src/pulse/def.h @@ -1,8 +1,6 @@ #ifndef foodefhfoo #define foodefhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/error.c b/src/pulse/error.c index 78f0da95..29690c89 100644 --- a/src/pulse/error.c +++ b/src/pulse/error.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/error.h b/src/pulse/error.h index 44a2e5ec..9f9e3d33 100644 --- a/src/pulse/error.h +++ b/src/pulse/error.h @@ -1,8 +1,6 @@ #ifndef fooerrorhfoo #define fooerrorhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/gccmacro.h b/src/pulse/gccmacro.h index 032c3bae..e4062033 100644 --- a/src/pulse/gccmacro.h +++ b/src/pulse/gccmacro.h @@ -1,8 +1,6 @@ #ifndef foopulsegccmacrohfoo #define foopulsegccmacrohfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/glib-mainloop.c b/src/pulse/glib-mainloop.c index b7a7537a..6ddb0faa 100644 --- a/src/pulse/glib-mainloop.c +++ b/src/pulse/glib-mainloop.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/glib-mainloop.h b/src/pulse/glib-mainloop.h index a4e06ea0..60fd61a3 100644 --- a/src/pulse/glib-mainloop.h +++ b/src/pulse/glib-mainloop.h @@ -1,8 +1,6 @@ #ifndef fooglibmainloophfoo #define fooglibmainloophfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/internal.h b/src/pulse/internal.h index d346e945..9ed541d1 100644 --- a/src/pulse/internal.h +++ b/src/pulse/internal.h @@ -1,8 +1,6 @@ #ifndef foointernalhfoo #define foointernalhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -75,8 +73,9 @@ struct pa_context { pa_mempool *mempool; - pa_bool_t is_local; - pa_bool_t do_autospawn; + pa_bool_t is_local:1; + pa_bool_t do_autospawn:1; + pa_bool_t do_shm:1; int autospawn_lock_fd; pa_spawn_api spawn_api; @@ -106,6 +105,8 @@ struct pa_stream { pa_context *context; pa_mainloop_api *mainloop; + uint32_t direct_on_input; + pa_stream_direction_t direction; pa_stream_state_t state; pa_stream_flags_t flags; @@ -115,8 +116,13 @@ 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; + uint32_t channel; - pa_bool_t channel_valid; uint32_t syncid; uint32_t stream_index; @@ -125,17 +131,13 @@ struct pa_stream { uint32_t device_index; char *device_name; - pa_bool_t suspended; pa_memchunk peek_memchunk; void *peek_data; pa_memblockq *record_memblockq; - pa_bool_t corked; - /* Store latest latency info */ pa_timing_info timing_info; - pa_bool_t timing_info_valid; /* Use to make sure that time advances monotonically */ pa_usec_t previous_time; @@ -150,7 +152,6 @@ struct pa_stream { /* Latency interpolation stuff */ pa_time_event *auto_timing_update_event; - pa_bool_t auto_timing_update_requested; pa_smoother *smoother; @@ -232,6 +233,4 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta #define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error) PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL) -void pa_init_proplist(pa_proplist *p); - #endif diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c index 857e82b4..4be2c62a 100644 --- a/src/pulse/introspect.c +++ b/src/pulse/introspect.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -106,7 +104,8 @@ static void context_get_server_info_callback(pa_pdispatch *pd, uint32_t command, pa_tagstruct_get_sample_spec(t, &i.sample_spec) < 0 || pa_tagstruct_gets(t, &i.default_sink_name) < 0 || pa_tagstruct_gets(t, &i.default_source_name) < 0 || - pa_tagstruct_getu32(t, &i.cookie) < 0) { + pa_tagstruct_getu32(t, &i.cookie) < 0 || + !pa_tagstruct_eof(t)) { pa_context_fail(o->context, PA_ERR_PROTOCOL); goto finish; @@ -1342,7 +1341,7 @@ pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, p return o; } -pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, char *sink_name, pa_context_success_cb_t cb, void* userdata) { +pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, const char *sink_name, pa_context_success_cb_t cb, void* userdata) { pa_operation *o; pa_tagstruct *t; uint32_t tag; @@ -1392,7 +1391,7 @@ pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, u return o; } -pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata) { +pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, const char *source_name, pa_context_success_cb_t cb, void* userdata) { pa_operation *o; pa_tagstruct *t; uint32_t tag; @@ -1442,7 +1441,7 @@ pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx return o; } -pa_operation* pa_context_suspend_sink_by_name(pa_context *c, char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata) { +pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata) { pa_operation *o; pa_tagstruct *t; uint32_t tag; @@ -1489,7 +1488,7 @@ pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int return o; } -pa_operation* pa_context_suspend_source_by_name(pa_context *c, char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata) { +pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata) { pa_operation *o; pa_tagstruct *t; uint32_t tag; diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h index d185a3a6..c8c13a75 100644 --- a/src/pulse/introspect.h +++ b/src/pulse/introspect.h @@ -1,8 +1,6 @@ #ifndef foointrospecthfoo #define foointrospecthfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -261,7 +259,7 @@ pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata); /** Suspend/Resume a sink. \since 0.9.7 */ -pa_operation* pa_context_suspend_sink_by_name(pa_context *c, char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata); +pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata); /** Suspend/Resume a sink. If idx is PA_INVALID_INDEX all sinks will be suspended. \since 0.9.7 */ pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata); @@ -433,7 +431,7 @@ pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sin pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata); /** Move the specified sink input to a different sink. \since 0.9.5 */ -pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, char *sink_name, pa_context_success_cb_t cb, void* userdata); +pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, const char *sink_name, pa_context_success_cb_t cb, void* userdata); /** Move the specified sink input to a different sink. \since 0.9.5 */ pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata); @@ -479,13 +477,13 @@ pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_ pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata); /** Move the specified source output to a different source. \since 0.9.5 */ -pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata); +pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, const char *source_name, pa_context_success_cb_t cb, void* userdata); /** Move the specified source output to a different source. \since 0.9.5 */ pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata); /** Suspend/Resume a source. \since 0.9.7 */ -pa_operation* pa_context_suspend_source_by_name(pa_context *c, char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata); +pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata); /** Suspend/Resume a source. If idx is PA_INVALID_INDEX all sources will be suspended. \since 0.9.7 */ pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata); diff --git a/src/pulse/mainloop-api.c b/src/pulse/mainloop-api.c index dda51297..90aff164 100644 --- a/src/pulse/mainloop-api.c +++ b/src/pulse/mainloop-api.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/mainloop-api.h b/src/pulse/mainloop-api.h index 985806e6..53c7411e 100644 --- a/src/pulse/mainloop-api.h +++ b/src/pulse/mainloop-api.h @@ -1,8 +1,6 @@ #ifndef foomainloopapihfoo #define foomainloopapihfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/mainloop-signal.c b/src/pulse/mainloop-signal.c index 91c6bf6d..9161dec4 100644 --- a/src/pulse/mainloop-signal.c +++ b/src/pulse/mainloop-signal.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/mainloop-signal.h b/src/pulse/mainloop-signal.h index bdb0f738..a6c16f2f 100644 --- a/src/pulse/mainloop-signal.h +++ b/src/pulse/mainloop-signal.h @@ -1,8 +1,6 @@ #ifndef foomainloopsignalhfoo #define foomainloopsignalhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index ad4e4e97..aaed3caf 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/mainloop.h b/src/pulse/mainloop.h index db2797fb..907e94a7 100644 --- a/src/pulse/mainloop.h +++ b/src/pulse/mainloop.h @@ -1,8 +1,6 @@ #ifndef foomainloophfoo #define foomainloophfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/operation.c b/src/pulse/operation.c index 6b5c142a..13b470a8 100644 --- a/src/pulse/operation.c +++ b/src/pulse/operation.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/operation.h b/src/pulse/operation.h index 97d1c6b8..188e2cb9 100644 --- a/src/pulse/operation.h +++ b/src/pulse/operation.h @@ -1,8 +1,6 @@ #ifndef foooperationhfoo #define foooperationhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c index 33bd274f..74aea20a 100644 --- a/src/pulse/proplist.c +++ b/src/pulse/proplist.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h index f433ec62..f75cca54 100644 --- a/src/pulse/proplist.h +++ b/src/pulse/proplist.h @@ -1,8 +1,6 @@ #ifndef foopulseproplisthfoo #define foopulseproplisthfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -24,6 +22,8 @@ USA. ***/ +#include <sys/types.h> + #include <pulse/cdecl.h> #include <pulse/gccmacro.h> @@ -40,16 +40,25 @@ PA_C_DECL_BEGIN * media.icon_name * media.role video, music, game, event, phone, production, filter, abstract, stream * event.id button-click, session-login - * event.x11.display - * event.x11.xid - * event.x11.x_pointer - * event.x11.y_pointer - * event.x11.button + * event.mouse.x + * event.mouse.y + * event.mouse.hpos + * event.mouse.vpos + * event.mouse.button + * window.name + * window.id + * window.icon + * window.icon_name + * window.x11.display + * window.x11.screen + * window.x11.monitor + * window.x11.xid * application.name "Rhythmbox Media Player" * application.id "org.gnome.rhythmbox" * application.version * application.icon * application.icon_name + * application.language * application.process.id * application.process.binary * application.process.user @@ -60,14 +69,14 @@ PA_C_DECL_BEGIN * device.bus_path * device.serial * device.vendor_product_id - * device.class sound, modem, monitor, filter + * device.class sound, modem, monitor, filter, abstract * device.form_factor laptop-speakers, external-speakers, telephone, tv-capture, webcam-capture, microphone-capture, headset * device.connector isa, pci, usb, firewire, bluetooth * device.access_mode mmap, mmap_rewrite, serial * device.master_device - * device.buffer_size + * device.bufferin.buffer_size + * device.bufferin.fragment_size */ - #define PA_PROP_MEDIA_NAME "media.name" #define PA_PROP_MEDIA_TITLE "media.title" #define PA_PROP_MEDIA_ARTIST "media.artist" @@ -77,11 +86,19 @@ PA_C_DECL_BEGIN #define PA_PROP_MEDIA_ICON_NAME "media.icon_name" #define PA_PROP_MEDIA_ROLE "media.role" #define PA_PROP_EVENT_ID "event.id" -#define PA_PROP_EVENT_X11_DISPLAY "event.x11.display" -#define PA_PROP_EVENT_X11_XID "event.x11.xid" #define PA_PROP_EVENT_MOUSE_X "event.mouse.x" #define PA_PROP_EVENT_MOUSE_Y "event.mouse.y" +#define PA_PROP_EVENT_MOUSE_HPOS "event.mouse.hpos" +#define PA_PROP_EVENT_MOUSE_VPOS "event.mouse.vpos" #define PA_PROP_EVENT_MOUSE_BUTTON "event.mouse.button" +#define PA_PROP_WINDOW_NAME "window.name" +#define PA_PROP_WINDOW_ID "window.id" +#define PA_PROP_WINDOW_ICON "window.icon" +#define PA_PROP_WINDOW_ICON_NAME "window.icon_name" +#define PA_PROP_WINDOW_X11_DISPLAY "window.x11.display" +#define PA_PROP_WINDOW_X11_SCREEN "window.x11.screen" +#define PA_PROP_WINDOW_X11_MONITOR "window.x11.monitor" +#define PA_PROP_WINDOW_X11_XID "window.x11.xid" #define PA_PROP_APPLICATION_NAME "application.name" #define PA_PROP_APPLICATION_ID "application.id" #define PA_PROP_APPLICATION_VERSION "application.version" @@ -174,9 +191,10 @@ int pa_proplist_unset_many(pa_proplist *p, const char * const keys[]); * to this variable should then be passed to pa_proplist_iterate() * which should be called in a loop until it returns NULL which * signifies EOL. The property list should not be modified during - * iteration through the list. On each invication this function will - * return the key string for the next entry. The keys in the property - * list do not have any particular order. \since 0.9.11 */ + * iteration through the list -- except for deleting the current + * looked at entry. On each invication this function will return the + * key string for the next entry. The keys in the property list do not + * have any particular order. \since 0.9.11 */ const char *pa_proplist_iterate(pa_proplist *p, void **state); /** Format the property list nicely as a human readable string. Call pa_xfree() on the result. \since diff --git a/src/pulse/pulseaudio.h b/src/pulse/pulseaudio.h index 88d1275b..ee8a4bb8 100644 --- a/src/pulse/pulseaudio.h +++ b/src/pulse/pulseaudio.h @@ -1,8 +1,6 @@ #ifndef foopulseaudiohfoo #define foopulseaudiohfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/sample.c b/src/pulse/sample.c index 43340f20..4aef5bb0 100644 --- a/src/pulse/sample.c +++ b/src/pulse/sample.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/sample.h b/src/pulse/sample.h index dedd72de..1ba3f871 100644 --- a/src/pulse/sample.h +++ b/src/pulse/sample.h @@ -1,8 +1,6 @@ #ifndef foosamplehfoo #define foosamplehfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -115,10 +113,10 @@ PA_C_DECL_BEGIN #endif /** Maximum number of allowed channels */ -#define PA_CHANNELS_MAX 32 +#define PA_CHANNELS_MAX 32U /** Maximum allowed sample rate */ -#define PA_RATE_MAX (48000*4) +#define PA_RATE_MAX (48000U*4U) /** Sample format */ typedef enum pa_sample_format { diff --git a/src/pulse/scache.c b/src/pulse/scache.c index e43a0b9f..5e31e7af 100644 --- a/src/pulse/scache.c +++ b/src/pulse/scache.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -29,8 +27,11 @@ #include <stdio.h> #include <string.h> +#include <pulse/utf8.h> + #include <pulsecore/pstream-util.h> #include <pulsecore/macro.h> +#include <pulsecore/proplist-util.h> #include "internal.h" @@ -39,6 +40,7 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) { pa_tagstruct *t; uint32_t tag; + const char *name; pa_assert(s); pa_assert(PA_REFCNT_VALUE(s) >= 1); @@ -46,6 +48,11 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) { PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE); PA_CHECK_VALIDITY(s->context, length > 0, PA_ERR_INVALID); + if (!(name = pa_proplist_gets(s->proplist, PA_PROP_EVENT_ID))) + name = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME); + + PA_CHECK_VALIDITY(s->context, name && *name && pa_utf8_valid(name), PA_ERR_INVALID); + pa_stream_ref(s); s->direction = PA_STREAM_UPLOAD; @@ -53,9 +60,7 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) { t = pa_tagstruct_command(s->context, PA_COMMAND_CREATE_UPLOAD_STREAM, &tag); - if (s->context->version < 13) - pa_tagstruct_puts(t, pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME)); - + pa_tagstruct_puts(t, name); pa_tagstruct_put_sample_spec(t, &s->sample_spec); pa_tagstruct_put_channel_map(t, &s->channel_map); pa_tagstruct_putu32(t, length); diff --git a/src/pulse/scache.h b/src/pulse/scache.h index 46d86a19..f380b4e8 100644 --- a/src/pulse/scache.h +++ b/src/pulse/scache.h @@ -1,8 +1,6 @@ #ifndef fooscachehfoo #define fooscachehfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/simple.c b/src/pulse/simple.c index 1072fb4d..70396835 100644 --- a/src/pulse/simple.c +++ b/src/pulse/simple.c @@ -1,6 +1,4 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/simple.h b/src/pulse/simple.h index 7fca6ac3..a1380a0a 100644 --- a/src/pulse/simple.h +++ b/src/pulse/simple.h @@ -1,8 +1,6 @@ #ifndef foosimplehfoo #define foosimplehfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 4268fd6f..3bee7a05 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -107,6 +105,8 @@ pa_stream *pa_stream_new_with_proplist( s->sample_spec = *ss; s->channel_map = *map; + s->direct_on_input = PA_INVALID_INDEX; + s->proplist = p ? pa_proplist_copy(p) : pa_proplist_new(); if (name) pa_proplist_sets(s->proplist, PA_PROP_MEDIA_NAME, name); @@ -475,6 +475,8 @@ void pa_command_stream_suspended(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUS if (s->suspended || s->corked) pa_smoother_pause(s->smoother, x); + else + pa_smoother_resume(s->smoother, x); } request_auto_timing_update(s, TRUE); @@ -625,7 +627,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 = 1; + s->timing_info.write_index_corrupt = TRUE; /* pa_log("write_index invalidated"); */ } @@ -634,7 +636,7 @@ 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 = 1; + s->timing_info.read_index_corrupt = TRUE; /* pa_log("read_index invalidated"); */ } @@ -838,6 +840,7 @@ static int create_stream( pa_assert(direction == PA_STREAM_PLAYBACK || direction == PA_STREAM_RECORD); PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE); + PA_CHECK_VALIDITY(s->context, s->direct_on_input == PA_INVALID_INDEX || direction == PA_STREAM_RECORD, PA_ERR_BADSTATE); PA_CHECK_VALIDITY(s->context, !(flags & ~(PA_STREAM_START_CORKED| PA_STREAM_INTERPOLATE_TIMING| PA_STREAM_NOT_MONOTONOUS| @@ -860,8 +863,8 @@ static int create_stream( * when they are passed but actually not supported. This makes * client development easier */ - PA_CHECK_VALIDITY(s->context, direction != PA_STREAM_PLAYBACK || !(flags & (PA_STREAM_START_MUTED)), PA_ERR_INVALID); - PA_CHECK_VALIDITY(s->context, direction != PA_STREAM_RECORD || !(flags & (PA_STREAM_PEAK_DETECT)), PA_ERR_INVALID); + PA_CHECK_VALIDITY(s->context, direction == PA_STREAM_PLAYBACK || !(flags & (PA_STREAM_START_MUTED)), PA_ERR_INVALID); + PA_CHECK_VALIDITY(s->context, direction == PA_STREAM_RECORD || !(flags & (PA_STREAM_PEAK_DETECT)), PA_ERR_INVALID); PA_CHECK_VALIDITY(s->context, !volume || volume->channels == s->sample_spec.channels, PA_ERR_INVALID); PA_CHECK_VALIDITY(s->context, !sync_stream || (direction == PA_STREAM_PLAYBACK && sync_stream->direction == PA_STREAM_PLAYBACK), PA_ERR_INVALID); @@ -954,6 +957,9 @@ static int create_stream( PA_TAG_BOOLEAN, flags & PA_STREAM_ADJUST_LATENCY, PA_TAG_PROPLIST, s->proplist, PA_TAG_INVALID); + + if (s->direction == PA_STREAM_RECORD) + pa_tagstruct_putu32(t, s->direct_on_input); } pa_pstream_send_tagstruct(s->context->pstream, t); @@ -2227,3 +2233,26 @@ pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], return o; } + +int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx) { + pa_assert(s); + pa_assert(PA_REFCNT_VALUE(s) >= 1); + + PA_CHECK_VALIDITY(s->context, sink_input_idx != PA_INVALID_INDEX, PA_ERR_INVALID); + PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE); + PA_CHECK_VALIDITY(s->context, s->context->version >= 13, PA_ERR_NOTSUPPORTED); + + s->direct_on_input = sink_input_idx; + + return 0; +} + +uint32_t pa_stream_get_monitor_stream(pa_stream *s) { + pa_assert(s); + pa_assert(PA_REFCNT_VALUE(s) >= 1); + + PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direct_on_input != PA_INVALID_INDEX, PA_ERR_BADSTATE, PA_INVALID_INDEX); + PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->context->version >= 13, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX); + + return s->direct_on_input; +} diff --git a/src/pulse/stream.h b/src/pulse/stream.h index ebb45f2b..55f36b7f 100644 --- a/src/pulse/stream.h +++ b/src/pulse/stream.h @@ -1,8 +1,6 @@ #ifndef foostreamhfoo #define foostreamhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -527,14 +525,14 @@ const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s); * server is at least PulseAudio 0.9.8. \since 0.9.8 */ pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata); -/* Change the stream sampling rate during playback. You need to pass +/** Change the stream sampling rate during playback. You need to pass * PA_STREAM_VARIABLE_RATE in the flags parameter of * pa_stream_connect() if you plan to use this function. Only valid * after the stream has been connected successfully and if the server * is at least PulseAudio 0.9.8. \since 0.9.8 */ pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata); -/* Update the property list of the sink input/source output of this +/** Update the property list of the sink input/source output of this * stream, adding new entries. Please note that it is highly * recommended to set as much properties initially via * pa_stream_new_with_proplist() as possible instead a posteriori with @@ -542,10 +540,20 @@ pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_strea * this stream to the right device. \since 0.9.11 */ pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_proplist *p, pa_stream_success_cb_t cb, void *userdata); -/* Update the property list of the sink input/source output of this +/** Update the property list of the sink input/source output of this * stream, remove entries. \since 0.9.11 */ pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata); +/** For record streams connected to a monitor source: monitor only a + * very specific sink input of the sink. Thus function needs to be + * called before pa_stream_connect_record() is called. \since + * 0.9.11 */ +int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx); + +/** Return what has been set with pa_stream_set_monitor_stream() + * ebfore. \since 0.9.11 */ +uint32_t pa_stream_get_monitor_stream(pa_stream *s); + PA_C_DECL_END #endif diff --git a/src/pulse/subscribe.c b/src/pulse/subscribe.c index 0c5686b7..d9c06b7e 100644 --- a/src/pulse/subscribe.c +++ b/src/pulse/subscribe.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/subscribe.h b/src/pulse/subscribe.h index c37ead57..0e4be8c3 100644 --- a/src/pulse/subscribe.h +++ b/src/pulse/subscribe.h @@ -1,8 +1,6 @@ #ifndef foosubscribehfoo #define foosubscribehfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c index e8c956bb..6b66696c 100644 --- a/src/pulse/thread-mainloop.c +++ b/src/pulse/thread-mainloop.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/thread-mainloop.h b/src/pulse/thread-mainloop.h index ea08f72a..521e29b0 100644 --- a/src/pulse/thread-mainloop.h +++ b/src/pulse/thread-mainloop.h @@ -1,8 +1,6 @@ #ifndef foothreadmainloophfoo #define foothreadmainloophfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/timeval.c b/src/pulse/timeval.c index 180e0159..9708a735 100644 --- a/src/pulse/timeval.c +++ b/src/pulse/timeval.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -140,7 +138,7 @@ struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v) { tv->tv_usec += (suseconds_t) v; /* Normalize */ - while (tv->tv_usec >= PA_USEC_PER_SEC) { + while ((unsigned) tv->tv_usec >= PA_USEC_PER_SEC) { tv->tv_sec++; tv->tv_usec -= PA_USEC_PER_SEC; } diff --git a/src/pulse/timeval.h b/src/pulse/timeval.h index 09d53974..ee398296 100644 --- a/src/pulse/timeval.h +++ b/src/pulse/timeval.h @@ -1,8 +1,6 @@ #ifndef footimevalhfoo #define footimevalhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -34,12 +32,12 @@ PA_C_DECL_BEGIN -#define PA_MSEC_PER_SEC 1000 -#define PA_USEC_PER_SEC 1000000 -#define PA_NSEC_PER_SEC 1000000000 -#define PA_USEC_PER_MSEC 1000 -#define PA_NSEC_PER_MSEC 1000000 -#define PA_NSEC_PER_USEC 1000 +#define PA_MSEC_PER_SEC ((pa_usec_t) 1000ULL) +#define PA_USEC_PER_SEC ((pa_usec_t) 1000000ULL) +#define PA_NSEC_PER_SEC ((pa_usec_t) 1000000000ULL) +#define PA_USEC_PER_MSEC ((pa_usec_t) 1000ULL) +#define PA_NSEC_PER_MSEC ((pa_usec_t) 1000000ULL) +#define PA_NSEC_PER_USEC ((pa_usec_t) 1000ULL) struct timeval; diff --git a/src/pulse/utf8.c b/src/pulse/utf8.c index b2f6c3bd..119be542 100644 --- a/src/pulse/utf8.c +++ b/src/pulse/utf8.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/utf8.h b/src/pulse/utf8.h index 840c74e0..6c7e7a5b 100644 --- a/src/pulse/utf8.h +++ b/src/pulse/utf8.h @@ -1,8 +1,6 @@ #ifndef fooutf8hfoo #define fooutf8hfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/util.c b/src/pulse/util.c index b6f57b96..c0911b51 100644 --- a/src/pulse/util.c +++ b/src/pulse/util.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/util.h b/src/pulse/util.h index 666ccce4..cf06d4fd 100644 --- a/src/pulse/util.h +++ b/src/pulse/util.h @@ -1,8 +1,6 @@ #ifndef fooutilhfoo #define fooutilhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/version.h.in b/src/pulse/version.h.in index dc0f8e3b..e6226c44 100644 --- a/src/pulse/version.h.in +++ b/src/pulse/version.h.in @@ -1,8 +1,6 @@ #ifndef fooversionhfoo /*-*-C-*-*/ #define fooversionhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/volume.c b/src/pulse/volume.c index 33ab1c5f..70d6f86a 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/volume.h b/src/pulse/volume.h index e7ceb0d7..3befb1da 100644 --- a/src/pulse/volume.h +++ b/src/pulse/volume.h @@ -1,8 +1,6 @@ #ifndef foovolumehfoo #define foovolumehfoo -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -103,10 +101,10 @@ PA_C_DECL_BEGIN typedef uint32_t pa_volume_t; /** Normal volume (100%) */ -#define PA_VOLUME_NORM ((pa_volume_t) 0x10000) +#define PA_VOLUME_NORM ((pa_volume_t) 0x10000U) /** Muted volume (0%) */ -#define PA_VOLUME_MUTED ((pa_volume_t) 0) +#define PA_VOLUME_MUTED ((pa_volume_t) 0U) /** A structure encapsulating a per-channel volume */ typedef struct pa_cvolume { @@ -169,7 +167,7 @@ double pa_sw_volume_to_linear(pa_volume_t v) PA_GCC_CONST; #define PA_DECIBEL_MININFTY ((double) -INFINITY) #else /** This value is used as minus infinity when using pa_volume_{to,from}_dB(). */ -#define PA_DECIBEL_MININFTY ((double) -200) +#define PA_DECIBEL_MININFTY ((double) -200.0) #endif PA_C_DECL_END diff --git a/src/pulse/xmalloc.c b/src/pulse/xmalloc.c index a64761bf..90237013 100644 --- a/src/pulse/xmalloc.c +++ b/src/pulse/xmalloc.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. diff --git a/src/pulse/xmalloc.h b/src/pulse/xmalloc.h index 62a450dc..c453138b 100644 --- a/src/pulse/xmalloc.h +++ b/src/pulse/xmalloc.h @@ -1,8 +1,6 @@ #ifndef foomemoryhfoo #define foomemoryhfoo -/* $Id$ */ - /*** This file is part of PulseAudio. |