bluez: Bump up priority for sockets in AVDTP elements

This is based on the code in PulseAudio.
This commit is contained in:
Arun Raghavan 2012-10-10 21:38:46 +05:30
parent f644b924d4
commit b8e2550362

View file

@ -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;