Improve pod filter

Reset the builder when the filter failed.
Make the plugins create their params in a temporary buffer, we
don't want to do in-place filtering because that is not always
possible. Because the filter now resets on error, we can remove
the reset from the plugins.
This commit is contained in:
Wim Taymans 2017-11-14 10:17:45 +01:00
parent 7a7c011b00
commit 52e1dad93e
15 changed files with 193 additions and 226 deletions

View file

@ -119,7 +119,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
int err, i, j, dir;
unsigned int min, max;
uint8_t buffer[4096];
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
struct spa_pod_builder b = { 0 };
struct spa_pod_prop *prop;
struct spa_pod *fmt;
int res;
@ -130,6 +130,8 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
return err;
next:
spa_pod_builder_init(&b, buffer, sizeof(buffer));
if (*index > 0)
return 0;