summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2017-04-07 08:20:43 +0200
committerGeorg Chini <georg@chini.tk>2017-04-07 08:20:43 +0200
commit6f2e22e7ad5671f687687ff2a8d66b95a7a30bef (patch)
tree711aa1634c1c8c0ef5e60d20dd858ad2559ec1c4
parentc936aa23c316ebf51eb2d7f44c88e6c8434a8da9 (diff)
parenta604d9cbb3199c2a4c7e12e37def228a43553890 (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/pulseaudio/pulseaudio
-rw-r--r--src/modules/module-pipe-sink.c9
-rw-r--r--src/pulse/thread-mainloop.h2
-rw-r--r--src/pulsecore/memblock.c2
-rw-r--r--src/pulsecore/protocol-native.c5
4 files changed, 13 insertions, 5 deletions
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index da650211..1c688d77 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -75,6 +75,7 @@ struct userdata {
char *filename;
int fd;
+ size_t buffer_size;
pa_memchunk memchunk;
@@ -123,7 +124,7 @@ static int process_render(struct userdata *u) {
pa_assert(u);
if (u->memchunk.length <= 0)
- pa_sink_render(u->sink, pa_frame_align(pa_pipe_buf(u->fd), &u->sink->sample_spec), &u->memchunk);
+ pa_sink_render(u->sink, u->buffer_size, &u->memchunk);
pa_assert(u->memchunk.length > 0);
@@ -306,8 +307,10 @@ int pa__init(pa_module *m) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- pa_sink_set_max_request(u->sink, pa_frame_align(pa_pipe_buf(u->fd), &u->sink->sample_spec));
- pa_sink_set_fixed_latency(u->sink, pa_bytes_to_usec(pa_pipe_buf(u->fd), &u->sink->sample_spec));
+
+ u->buffer_size = pa_frame_align(pa_pipe_buf(u->fd), &u->sink->sample_spec);
+ pa_sink_set_max_request(u->sink, u->buffer_size);
+ pa_sink_set_fixed_latency(u->sink, pa_bytes_to_usec(u->buffer_size, &u->sink->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);
diff --git a/src/pulse/thread-mainloop.h b/src/pulse/thread-mainloop.h
index 40278b4d..e69298aa 100644
--- a/src/pulse/thread-mainloop.h
+++ b/src/pulse/thread-mainloop.h
@@ -164,7 +164,7 @@ PA_C_DECL_BEGIN
* access this data safely, we must extend our example a bit:
*
* \code
- * static volatile int *drain_result = NULL;
+ * static int * volatile drain_result = NULL;
*
* static void my_drain_callback(pa_stream*s, int success, void *userdata) {
* pa_threaded_mainloop *m;
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index dbad32a2..fb83dac5 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -497,7 +497,7 @@ bool pa_memblock_is_read_only(pa_memblock *b) {
pa_assert(b);
pa_assert(PA_REFCNT_VALUE(b) > 0);
- return b->read_only && PA_REFCNT_VALUE(b) == 1;
+ return b->read_only || PA_REFCNT_VALUE(b) > 1;
}
/* No lock necessary */
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 13f4f623..efe9bd24 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -4721,6 +4721,11 @@ static void command_set_card_profile(pa_pdispatch *pd, uint32_t command, uint32_
CHECK_VALIDITY(c->pstream, profile, tag, PA_ERR_NOENTITY);
+ pa_log_info("Application \"%s\" requests card profile change. card = %s, profile = %s",
+ pa_strnull(pa_proplist_gets(c->client->proplist, PA_PROP_APPLICATION_NAME)),
+ card->name,
+ profile->name);
+
if ((ret = pa_card_set_profile(card, profile, true)) < 0) {
pa_pstream_send_error(c->pstream, tag, -ret);
return;