summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-04-21 10:31:45 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-04-21 10:31:45 +0300
commitfd0e49cb2329142be743726907efd8c0d92fd338 (patch)
tree6ec628a8332860da44526917cb927b2d4969cb50
parent071f7742be87a6532885ddf4116e5dde9398e836 (diff)
downloadbluez-fd0e49cb2329142be743726907efd8c0d92fd338.tar.gz
Clean up handle_transport_connect code flow
-rw-r--r--audio/avdtp.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 23281ac3d..24372a50e 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -877,6 +877,7 @@ static void handle_transport_connect(struct avdtp *session, GIOChannel *io,
{
struct avdtp_stream *stream = session->pending_open;
struct avdtp_local_sep *sep = stream->lsep;
+ int sk, buf_size, min_buf_size;
session->pending_open = NULL;
@@ -901,22 +902,21 @@ static void handle_transport_connect(struct avdtp *session, GIOChannel *io,
stream->omtu = omtu;
stream->imtu = imtu;
- /* only if local SEP is of type SRC */
- if (sep->info.type == AVDTP_SEP_TYPE_SOURCE) {
- int sk, buf_size, min_buf_size;
-
- sk = g_io_channel_unix_get_fd(stream->io);
- buf_size = get_send_buffer_size(sk);
- if (buf_size < 0)
- goto proceed;
-
- DBG("sk %d, omtu %d, send buffer size %d", sk, omtu, buf_size);
- min_buf_size = omtu * 2;
- if (buf_size < min_buf_size) {
- DBG("send buffer size to be increassed to %d",
- min_buf_size);
- set_send_buffer_size(sk, min_buf_size);
- }
+ /* Apply special settings only if local SEP is of type SRC */
+ if (sep->info.type != AVDTP_SEP_TYPE_SOURCE)
+ goto proceed;
+
+ sk = g_io_channel_unix_get_fd(stream->io);
+ buf_size = get_send_buffer_size(sk);
+ if (buf_size < 0)
+ goto proceed;
+
+ DBG("sk %d, omtu %d, send buffer size %d", sk, omtu, buf_size);
+ min_buf_size = omtu * 2;
+ if (buf_size < min_buf_size) {
+ DBG("send buffer size to be increassed to %d",
+ min_buf_size);
+ set_send_buffer_size(sk, min_buf_size);
}
proceed: