module-avb: internal: destroy internal descriptors

This commit is contained in:
hackerman-kl 2025-11-28 09:01:14 +01:00 committed by Wim Taymans
parent a3ce0f3e28
commit b60623df4d
4 changed files with 13 additions and 16 deletions

View file

@ -311,7 +311,7 @@ void avdecc_server_free(struct server *server)
{
struct impl *impl = server->impl;
stream_destroy_all(server);
server_destroy_descriptors(server);
spa_list_remove(&server->link);
if (server->source)
pw_loop_destroy_source(impl->loop, server->source);

View file

@ -83,7 +83,18 @@ struct server {
#include "stream.h"
static inline struct descriptor *server_find_descriptor(struct server *server,
static inline void server_destroy_descriptors(struct server *server)
{
struct descriptor *d, *t;
spa_list_for_each_safe(d, t, &server->descriptors, link) {
free(d->ptr);
spa_list_remove(&d->link);
free(d);
}
}
static inline const struct descriptor *server_find_descriptor(struct server *server,
uint16_t type, uint16_t index)
{
struct descriptor *d;

View file

@ -346,14 +346,6 @@ void stream_destroy(struct stream *stream)
avb_mrp_attribute_destroy(stream->listener_attr->mrp);
}
void stream_destroy_all(struct server *server)
{
struct stream *s, *t;
spa_list_for_each_safe(s, t, &server->streams, link) {
stream_destroy(s);
}
}
static int setup_socket(struct stream *stream)
{
struct server *server = stream->server;

View file

@ -76,12 +76,6 @@ struct stream *server_create_stream(struct server *server, struct stream *stream
void stream_destroy(struct stream *stream);
/**
* \brief unregister MRP attribute for the stream
* and free the allocated resources for the stream.
*/
void stream_destroy_all(struct server *server);
int stream_activate(struct stream *stream, uint16_t index, uint64_t now);
int stream_deactivate(struct stream *stream, uint64_t now);