Use the lower 32 bits of the object serial as the index. When there is
an overflow, use an invalid index, which will probably result in a
protocol error.
Don't use max_quantum as the upper quantum limit, this is now scaled
with the rate. Use quantum_limit instead. We don't really care about the
max_quantum anymore so get rid of the field.
Firstly, separate the message dropping logic into
its own `drop_from_out_queue()` function.
Secondly, do not check earlier messages if the NEW
event for a particular object has been reached while
processing a REMOVE event for that object.
Thirdly, if - while processing a REMOVE event -
the corresponding NEW event is found and dropped,
drop the REMOVE event as well.
See #1840
Parse the quantum_limit parameters and use this to scale the buffers so
that they can contain the maximum allowed samples instead of the
hardcoded 8192 value.
See #1931
Also scale the max_quantum with the selected rate. Add a new
quantum_limit property that is the upper limit of the quantum regardless
of the sample rate, this is usually the allocated buffer size.
See #1931
Based on patch from Barnabás Pőcze <pobrn@protonmail.com>
Instead of trying to keep track of the missing bytes ourselves, use the
simple tlength - avail - requested formula to request more bytes from
the client.
Fixes#1981
Extend the server.address property so that you can also specify
an object per server. Add support for configuring some aspects of the
server such as max-clients and backlog.
Most importantly, the pipewire client.access can be configured per
server.
See #1960
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
For example, pulseaudio.js[1] immediately sends a
GET_SERVER_INFO request after AUTH, and only later
issues a SET_CLIENT_NAME.
See #1966.
[1]: https://github.com/janakj/pulseaudio.js
By default require that a client is authenticated and
has a manager to be allowed to run a command.
Specially:
* AUTH requires nothing
* SET_CLIENT_NAME and STAT only require authentication
Two `pw_properties` objects are not freed in the error path.
Resolves Coverity issues: 1468665, 1468666, 1468667, 1468668.
Furthermore, the module argument string is also not freed.
Keep track of the created services in two lists: published, pending.
Move services between the lists as the avahi client's state changes:
keep services in the pending list until the avahi daemon appears on dbus,
move them to the pending list if connection is lost,
and re-publish them after reconnection.
When a module's `load()` fails, its `unload()` will unconditionally
be called. Freeing resource in `load()` while not marking those
resources freed (e.g. setting the pointers to NULL) will result
in double-free when the module's `unload()` method is called.
Whether the object is a sink or source is already queried at the
beginning of the function, and is kept in local variables.
Use those instead of calling `pw_manager_object_is_{sink,source}()` again.