mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
Use int counters for iterating items
Use counters instead of void* to iterate items. This simplifies some things and makes it easier to do over the wire. Add format description to NodeInfo and use this to add format descriptions to pinos devices. Small fixes to fix leaks and crashes.
This commit is contained in:
parent
8b84d8fde6
commit
b38ecafe81
38 changed files with 363 additions and 330 deletions
|
|
@ -78,7 +78,7 @@ do_negotiate (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
|
|||
PinosLinkImpl *impl = SPA_CONTAINER_OF (this, PinosLinkImpl, this);
|
||||
SpaResult res;
|
||||
SpaFormat *filter = NULL, *format;
|
||||
void *istate = NULL, *ostate = NULL;
|
||||
unsigned int iidx = 0, oidx = 0;
|
||||
char *error = NULL;
|
||||
|
||||
if (in_state != SPA_NODE_STATE_CONFIGURE && out_state != SPA_NODE_STATE_CONFIGURE)
|
||||
|
|
@ -95,8 +95,8 @@ again:
|
|||
this->input->port_id,
|
||||
&filter,
|
||||
NULL,
|
||||
&istate)) < 0) {
|
||||
if (res == SPA_RESULT_ENUM_END && istate != NULL) {
|
||||
iidx)) < 0) {
|
||||
if (res == SPA_RESULT_ENUM_END && iidx != 0) {
|
||||
asprintf (&error, "error input enum formats: %d", res);
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -110,9 +110,10 @@ again:
|
|||
this->output->port_id,
|
||||
&format,
|
||||
filter,
|
||||
&ostate)) < 0) {
|
||||
oidx)) < 0) {
|
||||
if (res == SPA_RESULT_ENUM_END) {
|
||||
ostate = NULL;
|
||||
oidx = 0;
|
||||
iidx++;
|
||||
goto again;
|
||||
}
|
||||
asprintf (&error, "error output enum formats: %d", res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue