summaryrefslogtreecommitdiff
path: root/android/avdtp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-28 09:14:43 -0800
committerSzymon Janc <szymon.janc@tieto.com>2014-01-29 00:31:59 +0100
commit6fe28e354d9678b7363b75bebbb75952e8c180ec (patch)
tree8a600987ed7edf20a660066bb8da54b75290f372 /android/avdtp.c
parente320320c372e884645a3e1eb5d69a05ce623b475 (diff)
downloadbluez-6fe28e354d9678b7363b75bebbb75952e8c180ec.tar.gz
android/AVDTP: Make signalling channel priority 6
This makes signalling priority 6 so it can push commands before the stream channel, without this the stream channel may be schedule first and cause the signalling commands to timeout while waiting a slot.
Diffstat (limited to 'android/avdtp.c')
-rw-r--r--android/avdtp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/android/avdtp.c b/android/avdtp.c
index 4abcd759e..e93ff70f4 100644
--- a/android/avdtp.c
+++ b/android/avdtp.c
@@ -2056,7 +2056,7 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)
{
struct avdtp *session;
GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
- int new_fd;
+ int new_fd, priority;
new_fd = dup(fd);
if (new_fd < 0) {
@@ -2064,6 +2064,14 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)
return NULL;
}
+ priority = 6;
+ if (setsockopt(new_fd, SOL_SOCKET, SO_PRIORITY, &priority,
+ sizeof(priority)) < 0) {
+ error("setsockopt(SO_PRIORITY): %s (%d)", strerror(errno),
+ errno);
+ return NULL;
+ }
+
session = g_new0(struct avdtp, 1);
session->io = g_io_channel_unix_new(new_fd);
session->version = version;