module-avb: avdecc: destroy stream

This commit is contained in:
hackerman-kl 2025-11-28 08:56:25 +01:00 committed by Wim Taymans
parent c10f869836
commit a3ce0f3e28
3 changed files with 15 additions and 0 deletions

View file

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

View file

@ -346,6 +346,14 @@ 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,6 +76,12 @@ 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);