From b8e25503623880c202637bfe81026f0be3499826 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 10 Oct 2012 21:38:46 +0530 Subject: [PATCH] bluez: Bump up priority for sockets in AVDTP elements This is based on the code in PulseAudio. --- sys/bluez/gstavdtputil.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/bluez/gstavdtputil.c b/sys/bluez/gstavdtputil.c index fa94572482..2d721cb7a7 100644 --- a/sys/bluez/gstavdtputil.c +++ b/sys/bluez/gstavdtputil.c @@ -29,6 +29,9 @@ #include #include +#include +#include + #include #include "a2dp-codecs.h" @@ -634,6 +637,7 @@ gst_avdtp_connection_conf_recv_stream_fd (GstAvdtpConnection * conn) GIOStatus status; GIOFlags flags; int fd; + int priority; /* Proceed if stream was already acquired */ if (conn->stream == NULL) { @@ -666,6 +670,11 @@ gst_avdtp_connection_conf_recv_stream_fd (GstAvdtpConnection * conn) if (status != G_IO_STATUS_NORMAL) GST_WARNING ("Error while setting server socket to block"); + priority = 6; + if (setsockopt (fd, SOL_SOCKET, SO_PRIORITY, (const void *) &priority, + sizeof (priority)) < 0) + GST_WARNING ("Unable to set socket to low delay"); + memset (data->buffer, 0, sizeof (data->buffer)); return TRUE;