summaryrefslogtreecommitdiff
path: root/src/modules/dbus/iface-core.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-29dbus: Deal with double-counting module-dbus-protocolArun Raghavan1-0/+8
We ended up dealing with it once in module init, and once more in the new module callback. Avoiding it in the second case by name seems to be the cleanest solution (else, we need to store the module index somewhere in pa_dbusiface_core, which seems about as bad). Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2016-05-29dbus: fix crash on LoadModule()Tanu Kaskinen1-14/+11
Commit ae415b07a07c9fe70714d01c91980edb25d966de ("dbus: Use hooks for module new and removed events") changed the new module monitoring from the asynchronous subscription system. Previously handle_load_module() created the new pa_dbusiface_module object before we got a notification of the loading of the module, but now we get the notification already within the pa_module_load() call. That resulted in a crash, because the module_new_cb() created the pa_dbusiface_module object before pa_module_load() returned, and then handle_load_module() would create another pa_dbusiface_module object for the same module. This patch removes the pa_dbusiface_module_new() call from handle_load_module(). module_new_cb() is now responsible for all pa_dbusiface_module object creations, except the ones that are created during the initialization of module-dbus-protocol. Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
2015-12-08core, pulse, modules: Fix undefined behavior with array subscript of invalid ↵Kamil Rytarowski1-1/+1
type From the NetBSD manual: The first argument of these functions is of type int, but only a very restricted subset of values are actually valid. The argument must either be the value of the macro EOF (which has a negative value), or must be a non-negative value within the range representable as unsigned char. Passing invalid values leads to undefined behavior. -- ctype(3)
2015-09-25Rename functions with "tostring" in the name to one with "to_string" to ↵Deepak Srivastava1-1/+1
conform with the convention. component: core <EP-E358F00C1D9A449EAE69225B9D2530F8> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833 Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-05-21dbus: Use hooks for module new and removed eventsJuho Hämäläinen1-38/+48
2015-05-21dbus: Use hooks for sample cache new and removed eventsJuho Hämäläinen1-35/+61
2015-04-02dbus: Use hooks for default sink and source changesJuho Hämäläinen1-62/+84
[Fixes by David Henningsson <david.henningsson@canonical.com>]
2015-04-02dbus: Use hooks for put and unlinkJuho Hämäläinen1-134/+239
Use hooks for all events that have core hooks defined. Some events handled in iface-core don't have hooks so leave those for later.
2015-01-14update FSF addresses to FSF web pageOndrej Holecek1-3/+1
FSF addresses used in PA sources are no longer valid and rpmlint generates numerous warnings during packaging because of this. This patch changes all FSF addresses to FSF web page according to the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html Done automatically by sed-ing through sources.
2014-06-05source, sink: Support weird sample ratesAlexander E. Patrakov1-4/+2
This fixes assertion failures that manifest themselves with cards that support only weird rates such as 37286Hz. Tested with snd-pcsp. Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48109
2013-12-15Add pa_sample_rate_valid()Tanu Kaskinen1-3/+3
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of sample rate values.
2013-12-15Add pa_sample_format_valid()Tanu Kaskinen1-2/+2
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of the sample format value.
2013-09-17hashmap: Add the ability to free keysArun Raghavan1-22/+26
Since the hashmap stores a pointer to the key provided at pa_hashmap_put() time, it make sense to allow the hashmap to be given ownership of the key and have it free it at pa_hashmap_remove/free time. To do this cleanly, we now provide the key and value free functions at hashmap creation time with a pa_hashmap_new_full. With this, we do away with the free function that was provided at remove/free time for freeing the value.
2013-07-04Revert dbus_bool_t variables to use TRUE/FALSE instead of true/falsepoljar (Damir Jelić)1-1/+1
2013-07-04Remove pa_bool_t and replace it with bool.poljar (Damir Jelić)1-7/+7
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
2013-06-24Whitespace cleanup: Fix broken indentation by handpoljar (Damir Jelić)1-32/+32
This patch fixes wrong indentation introduced by the last patch. This was mostly done with vim-s retab feature.
2013-06-24Whitespace cleanup: Remove tabspoljar (Damir Jelić)1-32/+32
This patch removes all tabs hidden inside the source tree and replaces them with 4 spaces. Command used for this: find . -type d \( -name bluetooth \) -prune -o -regex '\(.*\.[hc]\|.*\.cc\)' -a -not -name 'reserve*.[ch]' -a -not -name 'gnt*.h' -a -not -name 'adrian*' -exec sed -i -e 's/\t/ /g' {} \; The excluded files are mirrored files from external sources containing tabs.
2013-02-16hashmap: Use pa_free_cb_t instead of pa_free2_cb_tTanu Kaskinen1-58/+10
The previous patch removed module-gconf's dependency on the userdata pointer of the free callback, and that was the only place where the userdata pointer of pa_free2_cb_t was used, so now there's no need for pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows removing a significant amount of repetitive code.
2012-03-28dbus: Add an assertion to get rid of a warning from Coverity.Tanu Kaskinen1-1/+1
Coverity thinks that sample can be NULL when it's dereferenced after this line. Adding an assertion doesn't hurt here (in my opinion), and that should get rid of the warning.
2011-10-17core: infrastructure for alternate sampling ratePierre-Louis Bossart1-1/+44
New parameter to avoid resampling. BIG power savings here... Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-08-25Remove extra ; s where they are not allowed in strict C99Maarten Bosmans1-1/+1
2011-08-15Avoid read from freed memoryMaarten Bosmans1-2/+4
The order of freeing the hashmaps is important here, because otherwise a string used as key is freed before the hashmap is freed. Valgrind reports this as: Invalid read of size 1 at 0x4107042: pa_idxset_string_hash_func (idxset.c:67) by 0x4106026: remove_entry (hashmap.c:93) by 0x41061BF: pa_hashmap_free (hashmap.c:110) by 0x71DD143: pa_dbusiface_core_free (iface-core.c:2105) by 0x71F2169: module_dbus_protocol_LTX_pa__done (module-dbus-protocol.c:595) by 0x406DC51: pa_module_free (module.c:162) by 0x406E01D: pa_module_unload_all (module.c:210) by 0x4068842: core_free (core.c:169) by 0x406FD5D: pa_object_unref (object.c:64) by 0x805224D: pa_core_unref (core.h:184) by 0x805560B: main (main.c:1159) Address 0x4d099c0 is 0 bytes inside a block of size 100 free'd at 0x4025BF0: free (vg_replace_malloc.c:366) by 0x40F128C: pa_xfree (xmalloc.c:131) by 0x71E4CEB: pa_dbusiface_device_free (iface-device.c:1293) by 0x71DCD7E: free_device_cb (iface-core.c:2062) by 0x41061D7: pa_hashmap_free (hashmap.c:113) by 0x71DD125: pa_dbusiface_core_free (iface-core.c:2104) by 0x71F2169: module_dbus_protocol_LTX_pa__done (module-dbus-protocol.c:595) by 0x406DC51: pa_module_free (module.c:162) by 0x406E01D: pa_module_unload_all (module.c:210) by 0x4068842: core_free (core.c:169) by 0x406FD5D: pa_object_unref (object.c:64) by 0x805224D: pa_core_unref (core.h:184)
2011-03-25dbus: Do not refcnt the core.Colin Guthrie1-2/+1
We should not call pa_core_ref() anywhere in the code. Doing so will prevent proper daemon shutdown as the only call (in daemon/main.c) to pa_core_unref() should always call free_core() and perform a normal shutdown (i.e. unload all modules gracefully).
2010-10-15volume: Use a macro to check if a volume is validArun Raghavan1-1/+1
This adds a PA_VOLUME_IS_VALID() macro for checking if a given pa_volume_t is valid. This makes changes to the volume ranges simpler (just change PA_VOLUME_MAX, for example, without needing to modify any other code).
2010-08-10dbusiface-core: Track sinks and sources using synchronous hooks instead of ↵Tanu Kaskinen1-120/+130
asynchronous subscription events. Using the subscription events caused an assertion crash sometimes when a sink was removed and a new sink was created (i.e. card profile change) and a stream was moved from the removed sink to the new sink. The stream dbus object's subscription callback got a change event before the core dbus object's subscription callback got the sink remove/creation events. The stream's subscription callback then queried the core for the object path of the new sink, and since the core was not yet aware of the new sink, an assertion was hit in pa_dbusiface_device_get_path(). Now that the core uses synchronous hooks to keep the sink and source lists up to date, this particular problem can't occur anymore.
2009-11-21Rename all the signal parameters and variables to something more explicit.Diego Elio 'Flameeyes' Pettenò1-136/+136
Without this change, on FreeBSD you'll be bothered by tons of warnings about overshadowing signal(2).
2009-08-31dbusiface-core: Add signals FallbackSinkUnset and FallbackSourceUnset.Tanu Kaskinen1-0/+20
2009-08-30dbus: Do message argument type checking early, centrally.Tanu Kaskinen1-159/+88
2009-08-26dbus: Make sure that subscription callbacks don't try to access removed objects.Tanu Kaskinen1-71/+131
2009-08-24dbusiface-module: Implement the Module D-Bus interface.Tanu Kaskinen1-3/+3
2009-08-19dbusiface-core: Assert that _add/remove_interface calls succeed.Tanu Kaskinen1-2/+2
2009-08-19dbusiface-core: Use the PA_IDXSET_FOREACH macro.Tanu Kaskinen1-8/+8
2009-08-19dbusiface-core: Split some overly long lines.Tanu Kaskinen1-42/+118
2009-08-17dbusiface-core: Two new functions: pa_dbusiface_core_get_sink/source().Tanu Kaskinen1-0/+28
2009-08-17dbusiface-core: New function: pa_dbusiface_core_get_client_path().Tanu Kaskinen1-0/+7
2009-08-15dbusiface-core: Two new functions: ↵Tanu Kaskinen1-0/+14
pa_dbusiface_core_get_playback/record_stream_path().
2009-08-15dbusiface-core: New function: pa_dbusiface_core_get_card_path().Tanu Kaskinen1-0/+7
2009-08-09dbusiface-core: Add functions for getting various object paths.Tanu Kaskinen1-0/+21
2009-08-09dbusiface-core: Generate more informative error messages.Tanu Kaskinen1-4/+4
2009-08-09dbus: Take advantage of the PA_HASHMAP_FOREACH macro.Tanu Kaskinen1-40/+24
2009-08-09dbus: Three entangled changes:Tanu Kaskinen1-48/+44
* Make the dbus object constructors take a pa_dbusiface_core pointer as an argument. Remove the path_prefix argument. * Expose the core object path as a constant in protocol-dbus.h. * Move the core interface name constant from iface-core.h to protocol-dbus.h.
2009-08-04dbusiface-memstats: Implement the Memstats D-Bus interface.Tanu Kaskinen1-0/+5
2009-08-04dbus-protocol, dbusiface-core: Take a reference when storing the core pointer.Tanu Kaskinen1-1/+2
2009-08-04dbusiface-core: Make the interface string a public constant.Tanu Kaskinen1-25/+24
2009-08-01dbusiface-core: Don't die if we get a default sink/source change event ↵Tanu Kaskinen1-8/+42
before the new default device is actually created.
2009-07-31dbusiface-core: Send signals whenever extensions are registered and ↵Tanu Kaskinen1-0/+47
unregistered.
2009-07-30dbus/iface-core.c: Make sure D-Bus objects are created only once.Tanu Kaskinen1-20/+28
2009-07-27Bug fixing and minor cleanups.Tanu Kaskinen1-51/+44
2009-07-21Add the forgotten src/modules/dbus directory to git.Tanu Kaskinen1-0/+1968