[pulseaudio-commits] r1333 - in /trunk/src/modules: module-combine.c module-tunnel.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sat Aug 26 12:00:26 PDT 2006
Author: lennart
Date: Sat Aug 26 21:00:22 2006
New Revision: 1333
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1333&root=pulseaudio&view=rev
Log:
fix module-combine when used on top of a tunnel sink
Modified:
trunk/src/modules/module-combine.c
trunk/src/modules/module-tunnel.c
Modified: trunk/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-combine.c?rev=1333&root=pulseaudio&r1=1332&r2=1333&view=diff
==============================================================================
--- trunk/src/modules/module-combine.c (original)
+++ trunk/src/modules/module-combine.c Sat Aug 26 21:00:22 2006
@@ -217,6 +217,18 @@
pa_sink_get_latency(u->master->sink_input->sink);
}
+static void sink_notify(pa_sink *s) {
+ struct userdata *u;
+ struct output *o;
+
+ assert(s);
+ u = s->userdata;
+ assert(u);
+
+ for (o = u->outputs; o; o = o->next)
+ pa_sink_notify(o->sink_input->sink);
+}
+
static struct output *output_new(struct userdata *u, pa_sink *sink, int resample_method) {
struct output *o = NULL;
char t[256];
@@ -237,7 +249,7 @@
0,
NULL);
- snprintf(t, sizeof(t), "%s: output #%u", u->sink->name, u->n_outputs+1);
+ snprintf(t, sizeof(t), "Output stream #%u of sink %s", u->n_outputs+1, u->sink->name);
pa_sink_input_new_data_init(&data);
data.sink = sink;
@@ -387,8 +399,9 @@
}
pa_sink_set_owner(u->sink, m);
- pa_sink_set_description(u->sink, "Combined sink");
+ pa_sink_set_description(u->sink, "Combined Sink");
u->sink->get_latency = sink_get_latency_cb;
+ u->sink->notify = sink_notify;
u->sink->userdata = u;
if (!(u->master = output_new(u, master_sink, resample_method))) {
Modified: trunk/src/modules/module-tunnel.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-tunnel.c?rev=1333&root=pulseaudio&r1=1332&r2=1333&view=diff
==============================================================================
--- trunk/src/modules/module-tunnel.c (original)
+++ trunk/src/modules/module-tunnel.c Sat Aug 26 21:00:22 2006
@@ -266,6 +266,8 @@
pa_pstream_send_memblock(u->pstream, u->channel, 0, PA_SEEK_RELATIVE, &chunk);
pa_memblock_unref(chunk.memblock);
+/* pa_log("sent %lu", (unsigned long) chunk.length); */
+
if (chunk.length > u->requested_bytes)
u->requested_bytes = 0;
else
@@ -330,6 +332,8 @@
pa_gettimeofday(&now);
+ /* FIXME! This could use some serious love. */
+
if (pa_timeval_cmp(&local, &remote) < 0 && pa_timeval_cmp(&remote, &now)) {
/* local and remote seem to have synchronized clocks */
#ifdef TUNNEL_SINK
@@ -350,7 +354,7 @@
u->host_latency = 0;
#endif
-/* pa_log("estimated host latency: %0.0f usec", (double) u->host_latency); */
+/* pa_log("estimated host latency: %0.0f usec", (double) u->host_latency); */
}
static void request_latency(struct userdata *u) {
@@ -631,7 +635,6 @@
die(u);
}
-
static void pstream_packet_callback(pa_pstream *p, pa_packet *packet, const pa_creds *creds, void *userdata) {
struct userdata *u = userdata;
assert(p && packet && u);
@@ -772,6 +775,7 @@
return 0;
}
+
#else
static pa_usec_t source_get_latency(pa_source *source) {
struct userdata *u;
@@ -946,12 +950,12 @@
goto fail;
}
- u->sink->notify = sink_notify;
u->sink->get_latency = sink_get_latency;
u->sink->get_hw_volume = sink_get_hw_volume;
u->sink->set_hw_volume = sink_set_hw_volume;
u->sink->get_hw_mute = sink_get_hw_mute;
u->sink->set_hw_mute = sink_set_hw_mute;
+ u->sink->notify = sink_notify;
u->sink->userdata = u;
pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Tunnel to %s%s%s", u->sink_name ? u->sink_name : "", u->sink_name ? " on " : "", u->server_name));
pa_xfree(t);
More information about the pulseaudio-commits
mailing list