mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: Don't deref the transport to get the fd
Use the configured fd in the source for reading and writing because the transport might be disconnected and cleared from the main thread at any time.
This commit is contained in:
parent
580bdcd5bf
commit
7f6339e307
2 changed files with 2 additions and 2 deletions
|
|
@ -343,7 +343,7 @@ static int send_buffer(struct impl *this)
|
|||
spa_log_trace(this->log, NAME " %p: send %d %u %u %u",
|
||||
this, this->frame_count, this->seqnum, this->timestamp, this->buffer_used);
|
||||
|
||||
written = send(this->transport->fd, this->buffer, this->buffer_used, MSG_DONTWAIT | MSG_NOSIGNAL);
|
||||
written = send(this->flush_source.fd, this->buffer, this->buffer_used, MSG_DONTWAIT | MSG_NOSIGNAL);
|
||||
reset_buffer(this);
|
||||
|
||||
spa_log_debug(this->log, NAME " %p: send %d: %m", this, written);
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ static int32_t read_data(struct impl *this) {
|
|||
|
||||
again:
|
||||
/* read data from socket */
|
||||
size_read = read(this->transport->fd, this->buffer_read, b_size);
|
||||
size_read = read(this->source.fd, this->buffer_read, b_size);
|
||||
|
||||
if (size_read == 0)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue