diff options
Diffstat (limited to 'src/aucodec.c')
-rw-r--r-- | src/aucodec.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/aucodec.c b/src/aucodec.c index 67e3256..35076ed 100644 --- a/src/aucodec.c +++ b/src/aucodec.c @@ -9,20 +9,18 @@ #include "core.h" -static struct list aucodecl; - - /** * Register an Audio Codec * - * @param ac Audio Codec object + * @param aucodecl List of audio-codecs + * @param ac Audio Codec object */ -void aucodec_register(struct aucodec *ac) +void aucodec_register(struct list *aucodecl, struct aucodec *ac) { - if (!ac) + if (!aucodecl || !ac) return; - list_append(&aucodecl, &ac->le, ac); + list_append(aucodecl, &ac->le, ac); info("aucodec: %s/%u/%u\n", ac->name, ac->srate, ac->ch); } @@ -42,12 +40,13 @@ void aucodec_unregister(struct aucodec *ac) } -const struct aucodec *aucodec_find(const char *name, uint32_t srate, +const struct aucodec *aucodec_find(const struct list *aucodecl, + const char *name, uint32_t srate, uint8_t ch) { struct le *le; - for (le=aucodecl.head; le; le=le->next) { + for (le=list_head(aucodecl); le; le=le->next) { struct aucodec *ac = le->data; @@ -65,12 +64,3 @@ const struct aucodec *aucodec_find(const char *name, uint32_t srate, return NULL; } - - -/** - * Get the list of Audio Codecs - */ -struct list *aucodec_list(void) -{ - return &aucodecl; -} |