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:
Wim Taymans 2017-02-01 08:58:21 +01:00
parent 8b84d8fde6
commit b38ecafe81
38 changed files with 363 additions and 330 deletions

View file

@ -24,15 +24,11 @@ extern const SpaHandleFactory spa_audiomixer_factory;
SpaResult
spa_enum_handle_factory (const SpaHandleFactory **factory,
void **state)
unsigned int index)
{
int index;
if (factory == NULL || state == NULL)
if (factory == NULL)
return SPA_RESULT_INVALID_ARGUMENTS;
index = (*state == NULL ? 0 : *(int*)state);
switch (index) {
case 0:
*factory = &spa_audiomixer_factory;
@ -40,6 +36,5 @@ spa_enum_handle_factory (const SpaHandleFactory **factory,
default:
return SPA_RESULT_ENUM_END;
}
*(int*)state = ++index;
return SPA_RESULT_OK;
}