mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
initialize max_request to SO_SNDBUF
This commit is contained in:
parent
98a5f4a991
commit
fdbe0543be
1 changed files with 10 additions and 0 deletions
|
|
@ -354,6 +354,9 @@ static int do_write(struct userdata *u) {
|
|||
}
|
||||
|
||||
if (!u->write_data && u->state == STATE_PREPARE) {
|
||||
int so_sndbuf = 0;
|
||||
socklen_t sl = sizeof(int);
|
||||
|
||||
/* OK, we're done with sending all control data we need to, so
|
||||
* let's hand the socket over to the IO thread now */
|
||||
|
||||
|
|
@ -366,6 +369,13 @@ static int do_write(struct userdata *u) {
|
|||
|
||||
pa_make_tcp_socket_low_delay(u->fd);
|
||||
|
||||
if (getsockopt(u->fd, SOL_SOCKET, SO_SNDBUF, &so_sndbuf, &sl) < 0)
|
||||
pa_log_warn("getsockopt(SO_SNDBUF) failed: %s", pa_cstrerror(errno));
|
||||
else {
|
||||
pa_log_debug("SO_SNDBUF is %zu.", (size_t) so_sndbuf);
|
||||
pa_sink_set_max_request(u->sink, PA_MAX((size_t) so_sndbuf, u->block_size));
|
||||
}
|
||||
|
||||
pa_log_debug("Connection authenticated, handing fd to IO thread...");
|
||||
|
||||
pa_asyncmsgq_post(u->thread_mq.inq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_PASS_SOCKET, NULL, 0, NULL, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue