struct media_endpoint {
struct a2dp_sep *sep;
struct bt_bap_pac *pac;
- void *stream;
char *sender; /* Endpoint DBus bus id */
char *path; /* Endpoint object path */
char *uuid; /* Endpoint property UUID */
struct pac_config_data *data = user_data;
gboolean *ret_value = ret;
- if (ret_value)
- endpoint->stream = data->stream;
-
data->cb(data->stream, ret_value ? 0 : -EINVAL);
}
static void pac_clear(struct bt_bap_stream *stream, void *user_data)
{
struct media_endpoint *endpoint = user_data;
+ struct media_transport *transport;
+ const char *path;
+
+ path = bt_bap_stream_get_user_data(stream);
+ if (!path)
+ return;
- endpoint->stream = NULL;
+ DBG("endpoint %p path %s", endpoint, path);
- while (endpoint->transports != NULL)
- clear_configuration(endpoint, endpoint->transports->data);
+ transport = find_transport(endpoint, path);
+ if (transport) {
+ clear_configuration(endpoint, transport);
+ bt_bap_stream_set_user_data(stream, NULL);
+ }
}
static struct bt_bap_pac_ops pac_ops = {