OSDN Git Service

auto import from //branches/cupcake/...@132569
authorThe Android Open Source Project <initial-contribution@android.com>
Fri, 20 Feb 2009 15:38:28 +0000 (07:38 -0800)
committerThe Android Open Source Project <initial-contribution@android.com>
Fri, 20 Feb 2009 15:38:28 +0000 (07:38 -0800)
utils/audio/avdtp.c
utils/audio/sink.c

index 8bdfdb4..775c37b 100644 (file)
@@ -651,6 +651,8 @@ static void handle_transport_connect(struct avdtp *session, int sock,
        if (!stream->open_acp && sep->cfm && sep->cfm->open)
                sep->cfm->open(session, sep, stream, NULL, sep->user_data);
 
+       avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN);
+
        channel = g_io_channel_unix_new(stream->sock);
 
        stream->io = g_io_add_watch(channel, G_IO_ERR | G_IO_HUP | G_IO_NVAL,
@@ -1140,7 +1142,6 @@ static gboolean avdtp_open_cmd(struct avdtp *session, struct seid_req *req,
 
        stream->open_acp = TRUE;
        session->pending_open = stream;
-       avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN);
        stream->timer = g_timeout_add(REQ_TIMEOUT, stream_open_timeout,
                                                stream);
 
index 38ef2e6..dee0272 100644 (file)
@@ -379,7 +379,8 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
        if (id == 0)
                goto failed;
 
-       pending->id = id;
+       if (pending)
+               pending->id = id;
        return;
 
 failed: