summaryrefslogtreecommitdiff
path: root/src/pulse
AgeCommit message (Collapse)AuthorFilesLines
2014-08-24device-manager: Don't allow setting an empty description in the client APITanu Kaskinen1-0/+1
The module implementation treats an empty description as a protocol error, so we should validate the description already at client side.
2014-08-22format: Don't use deprecated json-c is_error() macroPeter Meerwald1-8/+8
json_tokener_parse() simply returns NULL on error these days latest json-c (post 0.12) doesn't automatically include json-c/bits.h anymore causing compilation errors Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-22format: Use json_object_object_get_ex() instead of deprecated ↵Peter Meerwald1-10/+8
json_object_object_get() pulse/format.c: In function 'pa_format_info_get_prop_type': pulse/format.c:252:5: warning: implicit declaration of function 'is_error' [-Wimplicit-function-declaration] pulse/format.c:287:13: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] pulse/format.c:293:13: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] pulse/format.c: In function 'pa_format_info_get_prop_int_range': pulse/format.c:364:5: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] pulse/format.c:369:5: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] pulse/format.c: In function 'pa_format_info_prop_compatible': pulse/format.c:676:9: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] pulse/format.c:680:9: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations] json-c 0.10 (released 20120530) added json_object_object_get_ex() json-c 0.12 (released 20140410) deprecated json_object_object_get() PulseAudio depends on json 0.9 or json-c 0.11, drop support for json 0.9 in a subsequent patch and require json-c 0.11 (this will also avoids confusion which json package is needed due to the upstream rename) Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-22format: Don't _put() objects obtained with json_object_object_get() or ↵Peter Meerwald1-9/+0
json_object_array_get_idx() json-c documentation states that "No reference counts will be changed. There is no need to manually adjust reference counts through the json_object_put/json_object_get methods unless..." hence fix pa_format_info_get_prop_type() and pa_format_info_get_prop_int_range(); note that pa_format_info_prop_compatible() is OK the json_object_array_get_idx() bug reported by Arun, thanks! Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Arun Raghavan <arun@accosted.net>
2014-08-18context: Handle client-side failure of pa_srbchannel_new_from_template()Peter Meerwald1-0/+4
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: David Henningsson <david.henningsson@canonical.com>
2014-08-18context: Stop and return if srbchannel memblock looks fishyPeter Meerwald1-3/+7
handle_srbchannel_memblock() should return when memblock sanity checks fail Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: David Henningsson <david.henningsson@canonical.com>
2014-08-12util: Fix pa_get_binary_name() on Debian/kFreeBSDPeter Meerwald1-2/+2
Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC, it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__ Debian GNU/kFreeBSD does have a /proc/self/exe FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__ problem reporte here: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe and http://stackoverflow.com/questions/933850/how-to-find-the-location-of-the-executable-in-c have some background info Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-07-28simple: Take locally buffered data into account in pa_simple_get_latency()Tanu Kaskinen1-3/+18
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81075
2014-07-12device-manager: Add a comment about non-extensible structTanu Kaskinen1-0/+3
This comment can potentially save a lot of debugging effort and fixing an ABI break, even though I don't think it's particularly likely that anyone will ever extend pa_ext_device_manager_role_priority_info.
2014-07-04creds: Unbreak build without HAVE_CREDSDavid Henningsson1-0/+7
A recent patch broke the build on FreeBSD, which does not have HAVE_CREDS defined. Also, make sure any attempts to enable the srbchannel on such architectures fail. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=80642 Reported-by: Ryan Lortie Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27Protocol, client: Add commands to enable srbchannelDavid Henningsson2-1/+110
This increments protocol version to v30 and adds two new commands to enable and disable an shm ringbuffer, as well as client side implementation. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27iochannel/pstream/pdispatch: Add support for receiving file descriptorsDavid Henningsson1-2/+2
The file descriptors are read from the iochannel just like the creds are. So instead of passing just creds (and creds_valid), we now pass the entire pa_ancil struct. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27client-conf: add missing directory to pulse/client-conf.x11.h includeEvan Nemerson1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=80570
2014-06-24esound, native: Pass an absolute path to pa_authkey_load() when using a file ↵Tanu Kaskinen1-3/+7
in the home directory If a relative path is passed to pa_authkey_load(), it will interpret the path as relative to the home directory. This is wrong, because relative paths should be interpreted to be relative to the config home directory. Before fixing pa_authkey_load(), this patch prepares for the change by using absolute paths when the file actually needs to be in the home directory (i.e. the fallback cookie path for the native protocol and the default cookie path for the esound protocol).
2014-06-24authkey: Rename pa_authkey_load_auto() to pa_authkey_load()Tanu Kaskinen1-6/+6
pa_authkey_load() was removed earlier, so the _auto suffix isn't necessary any more.
2014-06-24client-conf: Move x11 and env loading to pa_client_conf_load()Tanu Kaskinen3-53/+55
This simplifies the code a bit.
2014-06-24client-conf: Don't report failure from pa_client_conf_load()Tanu Kaskinen2-18/+9
pa_context already ignored the return value of pa_client_conf_load(), so the only places where the return value was not ignored were the D-Bus server lookup thing and pax11publish. I don't think those cases are negatively affected if they ignore errors in opening or parsing client.conf. pa_client_conf_env() never failed anyway, so returning int was obviously redundant.
2014-06-06mainloop: avoid race-y double wakeup statusPierre Ossman1-7/+2
Having an extra variable that tracks the wakeup status introduces a race where the variable is set but the data has yet to propagate from the write end of the pipe to the read end. When this happens the system goes into a tight loop as select() always returns immediately.
2014-05-27channelmap: Add 2.1 surroundDavid Henningsson1-0/+6
Add surround-21 as a alias to set up a 2.1 channel map. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-17Use pa_hashmap_remove_and_free() where appropriateTanu Kaskinen1-4/+1
2014-03-28client-conf: Don't create multiple cookie filesTanu Kaskinen4-88/+104
The old code loaded cookies at the time of loading the client configuration, which could lead to creation of multiple cookie files. For example, when pa_client_conf_load() was called, the default cookie file was created, and then if PULSE_COOKIE was set, pa_client_conf_env() would create another cookie file. This patch moves the loading of the cookie to a separate function, which pa_context calls just before needing the cookie, so the cookie won't be loaded from the default file if PULSE_COOKIE is set. This patch also splits the single cookie and cookie_file fields in pa_client_conf into multiple fields, one for each possible cookie source. That change allows falling back to another cookie source if the primary source doesn't work. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=75006
2014-03-28client-conf: Remove redundant function parametersTanu Kaskinen5-26/+14
2014-03-28util: Check that the home dir is an absolute pathTanu Kaskinen1-10/+22
Avoid unpredictable behaviour in case e.g. the HOME environment variable is incorrectly set up for whatever reason. I haven't seen non-absolute HOME anywhere, but this feels like a good sanity check anyway.
2014-03-27introspect: Use pa_direction_valid() to validate port directionTanu Kaskinen1-3/+3
There's no behavioral change, just nicer code.
2014-03-27direction: Add a couple of direction helper functionsTanu Kaskinen3-2/+86
2014-03-15mainloop-api: Improve pa_mainloop_api_once() documentationTanu Kaskinen1-3/+5
2014-03-14volume: Increase PA_SW_VOLUME_SNPRINT_DB_MAXTanu Kaskinen1-1/+1
10 bytes isn't enough for "-123.45 dB", including the terminating null byte.
2014-03-08doc: Use \since doxygen command correctly in mainloop-api.hPeter Meerwald1-3/+3
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-08doc: Use correct parameter name wait_for_accept in documentation of ↵Peter Meerwald1-2/+2
pa_threaded_mainloop_signal() also sneaks in a full stop in documentation elsewhere Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-07Fix a few "it's -> its" typosAlexander E. Patrakov1-1/+1
2014-03-06doc: Fix pa_stream_set_latency_update_callback() documentationPeter Meerwald1-1/+1
the latency_update callback is supported on playback AND record streams Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-06doc: Fix a couple of 'to to' typosPeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-02-23doc: Assorted spelling and grammar fixes for doxygen outputPeter Meerwald4-7/+7
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-01-23introspect, thread-mainloop: Fix Doxygen "since" tagsTanu Kaskinen2-4/+4
2014-01-08format: Add some error loggingTanu Kaskinen1-5/+26
2014-01-08stream: Mention pa_stream_new_extended() in the high-level stream creation ↵Tanu Kaskinen1-3/+8
documentation
2014-01-08stream: Improve pa_stream_connect_playback() documentationTanu Kaskinen1-1/+5
2014-01-08def, format: Document how to leave PCM parameters to be decided by the serverTanu Kaskinen2-9/+85
2014-01-08stream: Remove a volume channel validity checkTanu Kaskinen1-1/+0
The check is done for clients that use pa_stream_new() but not for clients that use pa_stream_new_extended(). This is inconsistent. We could check that the volume channels match the channels set in the format info struct that is passed to pa_stream_new_extended(), but that doesn't work if the format info doesn't contain the channel information (that can happen if the client wants the server to choose the channel count for the stream). And it should also be possible to pass a mono volume for a multi-channel stream. The check could be extended to handle all these cases, but I don't see much point in wasting time on that. The server will anyway validate the stream parameters, it's not particularly important to fail already when the stream is being created at the client side.
2014-01-08format, core-format: Constify some function parametersTanu Kaskinen2-18/+18
2014-01-08format: Simplify pa_format_info_to_sample_spec()Tanu Kaskinen1-10/+5
2014-01-08core-format: Add pa_format_info_get_channel_map()Tanu Kaskinen1-12/+2
2014-01-08core-format: Add pa_format_info_get_channels()Tanu Kaskinen1-4/+1
This also fixes an issue in pa_format_info_to_sample_spec(): it did no validation for the channels value. Now the validation is taken care of in pa_format_info_get_channels().
2014-01-08core-format: Add pa_format_info_get_rate()Tanu Kaskinen1-3/+2
This also fixes an issue in pa_format_info_to_sample_spec(): it did no validation for the rate value. Now the validation is taken care of in pa_format_info_get_rate().
2014-01-08core-format: Add pa_format_info_get_sample_format()Tanu Kaskinen1-7/+2
2014-01-08Move pa_format_info_to_sample_spec_fake() to core-formatTanu Kaskinen1-23/+2
I will need to use the function from outside libpulse. I added the channel map argument, because the function will be called from another function that is expected to initialize the channel map. I don't know if it's in practice necessary, but it shouldn't do any harm either.
2014-01-03Documentation of known misuse of PulseAudio APIAlexander E. Patrakov3-1/+56
Hello. Over time, I became aware of several instances of tempting but semantically incorrect usage of PulseAudio API (one from my own bad proposal of "improving" Wine, one from Parole media player and one from Webkit-GTK). I want to document these gotchas so that other developers don't fall for that. See the attached patch. I have checked that the rendered HTML is correct, but need someone to confirm the factual accuracy of the proposed changes and, possibly, to improve the wording. -- Alexander E. Patrakov
2013-12-20core: Remove dead code in pa_mainloop_run()Peter Meerwald1-3/+1
while ((r = pa_mainloop_iterate(m, 1, retval)) >= 0) ; if (r == -2) return 1; else if (r < 0) return -1; else return 0; the last else is never reached, discovered by coverity Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20simple: Enable pa_simple_flush() on record streams and amend documentationPeter Meerwald2-5/+3
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20doc: Document that pa_stream_flush() is applicable to playback and record ↵Peter Meerwald1-4/+3
streams Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>