--- a/src/pulsecore/mutex-posix.c +++ b/src/pulsecore/mutex-posix.c @@ -50,8 +50,10 @@ pa_assert_se(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) == 0); #ifdef HAVE_PTHREAD_PRIO_INHERIT - if (inherit_priority) - pa_assert_se(pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT) == 0); + if (inherit_priority) { + r = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); + pa_assert_se(r == 0 || r == ENOTSUP); + } #endif m = pa_xnew(pa_mutex, 1); --- a/src/modules/rtp/rtp.c +++ b/src/modules/rtp/rtp.c @@ -278,7 +278,7 @@ } for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm)) - if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP) { + if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_TIMESTAMP) { memcpy(tstamp, CMSG_DATA(cm), sizeof(struct timeval)); found_tstamp = TRUE; break; --- a/src/modules/rtp/module-rtp-recv.c +++ b/src/modules/rtp/module-rtp-recv.c @@ -428,11 +428,16 @@ pa_make_udp_socket_low_delay(fd); +#ifdef SO_TIMESTAMP one = 1; if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)) < 0) { pa_log("SO_TIMESTAMP failed: %s", pa_cstrerror(errno)); goto fail; } +#else + pa_log("SO_TIMESTAMP unsupported on this platform"); + goto fail; +#endif one = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) { --- a/src/modules/module-pipe-source.c +++ b/src/modules/module-pipe-source.c @@ -286,7 +286,7 @@ pa_source_set_asyncmsgq(u->source, u->thread_mq.inq); pa_source_set_rtpoll(u->source, u->rtpoll); - pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(PIPE_BUF, &u->source->sample_spec)); + pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(pa_pipe_buf(u->fd), &u->source->sample_spec)); u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1); pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); --- a/src/utils/pacmd.c +++ b/src/utils/pacmd.c @@ -47,8 +47,9 @@ int fd = -1; int ret = 1, i; struct sockaddr_un sa; - char ibuf[PIPE_BUF], obuf[PIPE_BUF]; - size_t ibuf_index, ibuf_length, obuf_index, obuf_length; + char *ibuf = NULL; + char *obuf = NULL; + size_t ibuf_size, ibuf_index, ibuf_length, obuf_size, obuf_index, obuf_length; char *cli; pa_bool_t ibuf_eof, obuf_eof, ibuf_closed, obuf_closed; struct pollfd pollfd[3]; @@ -102,6 +103,11 @@ goto fail; } + i = pa_pipe_buf(fd); + ibuf_size = PA_MIN(i, pa_pipe_buf(STDIN_FILENO)); + ibuf = pa_xmalloc(ibuf_size); + obuf_size = PA_MIN(i, pa_pipe_buf(STDOUT_FILENO)); + obuf = pa_xmalloc(obuf_size); ibuf_index = ibuf_length = obuf_index = obuf_length = 0; ibuf_eof = obuf_eof = ibuf_closed = obuf_closed = FALSE; @@ -109,11 +115,11 @@ for (i = 1; i < argc; i++) { size_t k; - k = PA_MIN(sizeof(ibuf) - ibuf_length, strlen(argv[i])); + k = PA_MIN(ibuf_size - ibuf_length, strlen(argv[i])); memcpy(ibuf + ibuf_length, argv[i], k); ibuf_length += k; - if (ibuf_length < sizeof(ibuf)) { + if (ibuf_length < ibuf_size) { ibuf[ibuf_length] = i < argc-1 ? ' ' : '\n'; ibuf_length++; } @@ -182,7 +188,7 @@ ssize_t r; pa_assert(ibuf_length <= 0); - if ((r = pa_read(STDIN_FILENO, ibuf, sizeof(ibuf), &stdin_type)) <= 0) { + if ((r = pa_read(STDIN_FILENO, ibuf, ibuf_size, &stdin_type)) <= 0) { if (r < 0) { pa_log(_("read(): %s"), strerror(errno)); goto fail; @@ -202,7 +208,7 @@ ssize_t r; pa_assert(obuf_length <= 0); - if ((r = pa_read(fd, obuf, sizeof(obuf), &fd_type)) <= 0) { + if ((r = pa_read(fd, obuf, obuf_size, &fd_type)) <= 0) { if (r < 0) { pa_log(_("read(): %s"), strerror(errno)); goto fail; @@ -260,5 +266,8 @@ if (fd >= 0) pa_close(fd); + pa_xfree(obuf); + pa_xfree(ibuf); + return ret; }