diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-15 22:57:49 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-15 22:57:49 +0000 |
commit | 1addff77624b54445c9b81779ddc78892a126a45 (patch) | |
tree | 322d0e61617a95fe908097c57e0b5ea0b834bfc2 /audio/a2dp.c | |
parent | 7502ca3e7eb95a7b349b5b9235ed50d542949f59 (diff) |
call avdtp_start from open_cfm instead of state callback
Diffstat (limited to 'audio/a2dp.c')
-rw-r--r-- | audio/a2dp.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c index 7574dbbb..b8431bc6 100644 --- a/audio/a2dp.c +++ b/audio/a2dp.c @@ -50,6 +50,9 @@ static uint32_t source_record_id = 0; static struct avdtp_local_sep *sink_sep = NULL; static struct avdtp_local_sep *source_sep = NULL; +static struct avdtp *start_session = NULL; +static struct avdtp_stream *start_stream = NULL; + static gboolean setconf_ind(struct avdtp *session, struct avdtp_local_sep *sep, struct avdtp_stream *stream, @@ -175,10 +178,22 @@ static gboolean open_ind(struct avdtp *session, struct avdtp_local_sep *sep, static void open_cfm(struct avdtp *session, struct avdtp_local_sep *sep, struct avdtp_stream *stream) { + int err; + if (sep == sink_sep) debug("SBC Sink: Open_Cfm"); else debug("SBC Source: Open_Cfm"); + + if (session != start_session || stream != start_stream) + return; + + start_session = NULL; + start_stream = NULL; + + err = avdtp_start(session, stream); + if (err < 0) + error("Error on avdtp_start %s (%d)", strerror(-err), err); } static gboolean start_ind(struct avdtp *session, struct avdtp_local_sep *sep, @@ -669,3 +684,11 @@ gboolean a2dp_get_config(struct avdtp_stream *stream, return TRUE; } + +void a2dp_start_stream_when_opened(struct avdtp *session, + struct avdtp_stream *stream) +{ + start_session = session; + start_stream = stream; + +} |