mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -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
|
|
@ -201,7 +201,8 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
SpaHandle *handle;
|
||||
SpaResult res;
|
||||
void *iface;
|
||||
void *hnd, *state = NULL;
|
||||
void *hnd;
|
||||
unsigned int index;
|
||||
SpaEnumHandleFactoryFunc enum_func;
|
||||
const SpaHandleFactory *factory;
|
||||
|
||||
|
|
@ -214,8 +215,8 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
goto no_symbol;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if ((res = enum_func (&factory, &state)) < 0) {
|
||||
for (index = 0;; index++) {
|
||||
if ((res = enum_func (&factory, index)) < 0) {
|
||||
if (res != SPA_RESULT_ENUM_END)
|
||||
pinos_log_error ("can't enumerate factories: %d", res);
|
||||
goto enum_failed;
|
||||
|
|
@ -256,12 +257,11 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
|
||||
spa_list_init (&impl->item_list);
|
||||
|
||||
state = NULL;
|
||||
while (true) {
|
||||
for (index = 0;; index++) {
|
||||
SpaMonitorItem *item;
|
||||
SpaResult res;
|
||||
|
||||
if ((res = spa_monitor_enum_items (this->monitor, &item, &state)) < 0) {
|
||||
if ((res = spa_monitor_enum_items (this->monitor, &item, index)) < 0) {
|
||||
if (res != SPA_RESULT_ENUM_END)
|
||||
pinos_log_debug ("spa_monitor_enum_items: got error %d\n", res);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue