gboolean start;
GSList *cb;
GIOChannel *io;
+ guint id;
int ref;
};
g_io_channel_unref(s->io);
}
+ if (s->id)
+ g_source_remove(s->id);
+
queue_destroy(s->eps, NULL);
setups = g_slist_remove(setups, s);
struct avdtp_media_codec_capability *rsep_codec;
struct avdtp_service_capability *cap;
+ setup->id = 0;
+
if (!sep->lsep) {
error("no valid local SEP");
posix_err = -EINVAL;
return FALSE;
}
+static bool setup_reconfigure(struct a2dp_setup *setup)
+{
+ if (!setup->reconfigure || setup->id)
+ return false;
+
+ DBG("%p", setup);
+
+ setup->id = g_timeout_add(RECONFIGURE_TIMEOUT, a2dp_reconfigure, setup);
+
+ setup->reconfigure = FALSE;
+
+ return true;
+}
+
static struct a2dp_remote_sep *get_remote_sep(struct a2dp_channel *chan,
struct avdtp_stream *stream)
{
if (!setup->rsep)
setup->rsep = get_remote_sep(setup->chan, stream);
- if (setup->reconfigure)
- g_timeout_add(RECONFIGURE_TIMEOUT, a2dp_reconfigure, setup);
+ setup_reconfigure(setup);
}
static void abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
if (!setup)
return;
- if (setup->reconfigure) {
- g_timeout_add(RECONFIGURE_TIMEOUT, a2dp_reconfigure, setup);
+ if (setup_reconfigure(setup))
return;
- }
setup_unref(setup);
}