diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-10-10 21:38:46 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-03-28 16:50:25 +0000 |
commit | b8e25503623880c202637bfe81026f0be3499826 (patch) | |
tree | 301591a614b23f2e90d77d54b77386f5ea399023 /sys | |
parent | f644b924d4e32c1f1c6e2e48931170e8def57e6f (diff) | |
download | gstreamer-plugins-bad-b8e25503623880c202637bfe81026f0be3499826.tar.gz |
bluez: Bump up priority for sockets in AVDTP elements
This is based on the code in PulseAudio.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/bluez/gstavdtputil.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/bluez/gstavdtputil.c b/sys/bluez/gstavdtputil.c index fa9457248..2d721cb7a 100644 --- a/sys/bluez/gstavdtputil.c +++ b/sys/bluez/gstavdtputil.c @@ -29,6 +29,9 @@ #include <string.h> #include <stdint.h> +#include <sys/types.h> +#include <sys/socket.h> + #include <bluetooth/bluetooth.h> #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; |