[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-152-g606c9ca
Lennart Poettering
gitmailer-noreply at 0pointer.de
Sun Dec 21 04:35:58 PST 2008
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 63fc26ed034846a8d2189e5cc2fe890ce3b4c7b3 (commit)
- Log -----------------------------------------------------------------
606c9ca... Implement PA_SOURCE_MESSAGE_GET_LATENCY
10cc4ba... Use FIONREAD instead of TIOCINQ
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-pipe-sink.c | 4 ++--
src/modules/module-pipe-source.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
commit 10cc4ba1ca53b56b58f4f04b4c5d49fa4e2b22dc
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Dec 21 13:33:32 2008 +0100
Use FIONREAD instead of TIOCINQ
On Linux the two ioctls FIONREAD and TIOCINQ share the same number.
However TIOCINQ is used for terminals while FIONREAD is used (among
others) for sockets and pipes. Hence use FIONREAD here since it seems
more appropriate.
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index ae230b2..2b55c82 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -101,8 +101,8 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
size_t n = 0;
int l;
-#ifdef TIOCINQ
- if (ioctl(u->fd, TIOCINQ, &l) >= 0 && l > 0)
+#ifdef FIONREAD
+ if (ioctl(u->fd, FIONREAD, &l) >= 0 && l > 0)
n = (size_t) l;
#endif
commit 606c9caa0b07ab0c8f18438a3fe24db2213188b5
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Dec 21 13:34:56 2008 +0100
Implement PA_SOURCE_MESSAGE_GET_LATENCY
The pipe source needs to implement PA_SOURCE_MESSAGE_GET_LATENCY since
we'll otherwise hit an assert.
Closes #424.
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 25151d9..e6437a0 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
+#include <sys/ioctl.h>
#include <sys/poll.h>
#include <pulse/xmalloc.h>
@@ -89,6 +90,34 @@ static const char* const valid_modargs[] = {
NULL
};
+static int source_process_msg(
+ pa_msgobject *o,
+ int code,
+ void *data,
+ int64_t offset,
+ pa_memchunk *chunk) {
+
+ struct userdata *u = PA_SOURCE(o)->userdata;
+
+ switch (code) {
+
+ case PA_SOURCE_MESSAGE_GET_LATENCY: {
+ size_t n = 0;
+ int l;
+
+#ifdef FIONREAD
+ if (ioctl(u->fd, FIONREAD, &l) >= 0 && l > 0)
+ n = (size_t) l;
+#endif
+
+ *((pa_usec_t*) data) = pa_bytes_to_usec(n, &u->source->sample_spec);
+ return 0;
+ }
+ }
+
+ return pa_source_process_msg(o, code, data, offset, chunk);
+}
+
static void thread_func(void *userdata) {
struct userdata *u = userdata;
int read_type = 0;
@@ -243,6 +272,7 @@ int pa__init(pa_module*m) {
goto fail;
}
+ u->source->parent.process_msg = source_process_msg;
u->source->userdata = u;
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list