From 1addff77624b54445c9b81779ddc78892a126a45 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 15 Aug 2007 22:57:49 +0000 Subject: call avdtp_start from open_cfm instead of state callback --- audio/sink.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'audio/sink.c') diff --git a/audio/sink.c b/audio/sink.c index 50d45718..fe8b6393 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -107,6 +107,9 @@ void stream_state_changed(struct avdtp_stream *stream, avdtp_state_t old_state, cmd_err); goto failed; } + + if (sink->c && sink->c->pkt) + a2dp_start_stream_when_opened(sink->session, stream); break; case AVDTP_STATE_OPEN: sink->suspending = FALSE; @@ -120,16 +123,9 @@ void stream_state_changed(struct avdtp_stream *stream, avdtp_state_t old_state, if (!sink->initiator) break; - if (sink->c && sink->c->pkt) { - cmd_err = avdtp_start(sink->session, stream); - if (cmd_err < 0) { - error("Error on avdtp_start %s (%d)", - strerror(-cmd_err), cmd_err); - goto failed; - } - } - else + if (!(sink->c && sink->c->pkt)) c = sink->c; + break; case AVDTP_STATE_STREAMING: c = sink->c; -- cgit