mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
bluez: Fix length header values in messages
This commit is contained in:
parent
b03faa59d1
commit
d8b5c0d9c9
1 changed files with 15 additions and 4 deletions
|
@ -780,6 +780,7 @@ gst_avdtp_sink_get_capabilities (GstAvdtpSink * self)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsp->h.length = 0;
|
||||||
io_error = gst_avdtp_sink_audioservice_expect (self,
|
io_error = gst_avdtp_sink_audioservice_expect (self,
|
||||||
&rsp->h, BT_GET_CAPABILITIES);
|
&rsp->h, BT_GET_CAPABILITIES);
|
||||||
if (io_error != G_IO_ERROR_NONE) {
|
if (io_error != G_IO_ERROR_NONE) {
|
||||||
|
@ -925,6 +926,7 @@ gst_avdtp_sink_stream_start (GstAvdtpSink * self)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsp->h.length = sizeof (*rsp);
|
||||||
io_error = gst_avdtp_sink_audioservice_expect (self,
|
io_error = gst_avdtp_sink_audioservice_expect (self,
|
||||||
&rsp->h, BT_START_STREAM);
|
&rsp->h, BT_START_STREAM);
|
||||||
if (io_error != G_IO_ERROR_NONE) {
|
if (io_error != G_IO_ERROR_NONE) {
|
||||||
|
@ -932,6 +934,7 @@ gst_avdtp_sink_stream_start (GstAvdtpSink * self)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ind->h.length = sizeof (*ind);
|
||||||
io_error = gst_avdtp_sink_audioservice_expect (self, &ind->h, BT_NEW_STREAM);
|
io_error = gst_avdtp_sink_audioservice_expect (self, &ind->h, BT_NEW_STREAM);
|
||||||
if (io_error != G_IO_ERROR_NONE) {
|
if (io_error != G_IO_ERROR_NONE) {
|
||||||
GST_ERROR_OBJECT (self, "Error while receiving " "stream filedescriptor");
|
GST_ERROR_OBJECT (self, "Error while receiving " "stream filedescriptor");
|
||||||
|
@ -1056,6 +1059,7 @@ gst_avdtp_sink_configure (GstAvdtpSink * self, GstCaps * caps)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req->h.length += req->codec.length - sizeof (req->codec);
|
||||||
io_error = gst_avdtp_sink_audioservice_send (self, &req->h);
|
io_error = gst_avdtp_sink_audioservice_send (self, &req->h);
|
||||||
if (io_error != G_IO_ERROR_NONE) {
|
if (io_error != G_IO_ERROR_NONE) {
|
||||||
GST_ERROR_OBJECT (self, "Error ocurred while sending "
|
GST_ERROR_OBJECT (self, "Error ocurred while sending "
|
||||||
|
@ -1063,6 +1067,7 @@ gst_avdtp_sink_configure (GstAvdtpSink * self, GstCaps * caps)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsp->h.length = sizeof (*rsp);
|
||||||
io_error = gst_avdtp_sink_audioservice_expect (self,
|
io_error = gst_avdtp_sink_audioservice_expect (self,
|
||||||
&rsp->h, BT_SET_CONFIGURATION);
|
&rsp->h, BT_SET_CONFIGURATION);
|
||||||
if (io_error != G_IO_ERROR_NONE) {
|
if (io_error != G_IO_ERROR_NONE) {
|
||||||
|
@ -1205,9 +1210,12 @@ gst_avdtp_sink_audioservice_send (GstAvdtpSink * self,
|
||||||
GIOError error;
|
GIOError error;
|
||||||
gsize written;
|
gsize written;
|
||||||
const char *type, *name;
|
const char *type, *name;
|
||||||
|
uint16_t length;
|
||||||
|
|
||||||
error = g_io_channel_write (self->server, (const gchar *) msg,
|
length = msg->length ? msg->length : BT_SUGGESTED_BUFFER_SIZE;
|
||||||
BT_SUGGESTED_BUFFER_SIZE, &written);
|
|
||||||
|
error = g_io_channel_write (self->server, (const gchar *) msg, length,
|
||||||
|
&written);
|
||||||
if (error != G_IO_ERROR_NONE)
|
if (error != G_IO_ERROR_NONE)
|
||||||
GST_ERROR_OBJECT (self, "Error sending data to audio service:"
|
GST_ERROR_OBJECT (self, "Error sending data to audio service:"
|
||||||
" %s(%d)", strerror (errno), errno);
|
" %s(%d)", strerror (errno), errno);
|
||||||
|
@ -1227,9 +1235,12 @@ gst_avdtp_sink_audioservice_recv (GstAvdtpSink * self,
|
||||||
GIOError status;
|
GIOError status;
|
||||||
gsize bytes_read;
|
gsize bytes_read;
|
||||||
const char *type, *name;
|
const char *type, *name;
|
||||||
|
uint16_t length;
|
||||||
|
|
||||||
status = g_io_channel_read (self->server, (gchar *) inmsg,
|
length = inmsg->length ? inmsg->length : BT_SUGGESTED_BUFFER_SIZE;
|
||||||
BT_SUGGESTED_BUFFER_SIZE, &bytes_read);
|
|
||||||
|
status = g_io_channel_read (self->server, (gchar *) inmsg, length,
|
||||||
|
&bytes_read);
|
||||||
if (status != G_IO_ERROR_NONE) {
|
if (status != G_IO_ERROR_NONE) {
|
||||||
GST_ERROR_OBJECT (self, "Error receiving data from " "audio service");
|
GST_ERROR_OBJECT (self, "Error receiving data from " "audio service");
|
||||||
return status;
|
return status;
|
||||||
|
|
Loading…
Reference in a new issue