summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac70
-rw-r--r--src/Makefile.am4
-rw-r--r--src/daemon/main.c2
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c4
-rw-r--r--src/modules/module-detect.c4
-rw-r--r--src/modules/module-hal-detect.c16
-rw-r--r--src/modules/module-ladspa-sink.c3
-rw-r--r--src/modules/module-remap-sink.c3
-rw-r--r--src/modules/module-tunnel.c4
-rw-r--r--src/pulse/mainloop.c13
-rw-r--r--src/pulsecore/sink.c32
-rw-r--r--src/pulsecore/sink.h4
-rw-r--r--src/pulsecore/source.c28
-rw-r--r--src/pulsecore/source.h4
-rw-r--r--src/tests/mix-test.c74
15 files changed, 145 insertions, 120 deletions
diff --git a/configure.ac b/configure.ac
index 179aeb36..db73d91c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -537,25 +537,6 @@ AC_SUBST(X11_LIBS)
AC_SUBST(HAVE_X11)
AM_CONDITIONAL([HAVE_X11], [test "x$HAVE_X11" = x1])
-#### Capabilities (optional) ####
-
-CAP_LIBS=''
-
-AC_ARG_WITH(
- [caps],
- AS_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
-
-if test "x${with_caps}" != "xno"; then
- AC_SEARCH_LIBS([cap_init], [cap], [], [
- if test "x${with_caps}" = "xyes" ; then
- AC_MSG_ERROR([*** POSIX caps libraries not found])
- fi])
- AC_CHECK_HEADERS([sys/capability.h], [], [
- if test "x${with_caps}" = "xyes" ; then
- AC_MSG_ERROR([*** POSIX caps headers not found])
- fi])
-fi
-
#### Valgrind (optional) ####
AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h])
@@ -683,26 +664,42 @@ AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
#### OSS support (optional) ####
-AC_ARG_ENABLE([oss],
- AS_HELP_STRING([--disable-oss],[Disable optional OSS support]),
+AC_ARG_ENABLE([oss-output],
+ AS_HELP_STRING([--disable-oss-output],[Disable optional OSS output support]),
[
case "${enableval}" in
- yes) oss=yes ;;
- no) oss=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
+ yes) oss_output=yes ;;
+ no) oss_output=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-output) ;;
esac
],
- [oss=auto])
+ [oss_output=auto])
-if test "x${oss}" != xno ; then
+AC_ARG_ENABLE([oss-wrapper],
+ AS_HELP_STRING([--disable-oss-wrapper],[Disable optional OSS wrapper support]),
+ [
+ case "${enableval}" in
+ yes) oss_wrapper=yes ;;
+ no) oss_wrapper=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-wrapper) ;;
+ esac
+ ],
+ [oss_wrapper=auto])
+
+if test "x${oss_output}" != xno || test "x${oss_wrapper}" != "xno"; then
AC_CHECK_HEADERS([sys/soundcard.h],
[
+ if test "x${oss_output}" != "xno"; then
+ AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
+ fi
+ if test "x${oss_wrapper}" != "xno"; then
+ AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])
+ fi
HAVE_OSS=1
- AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
],
[
HAVE_OSS=0
- if test "x$oss" = xyes ; then
+ if test "x$oss_output" = xyes || test "x$oss_wrapper" = "xyes"; then
AC_MSG_ERROR([*** OSS support not found])
fi
])
@@ -711,8 +708,8 @@ else
fi
AC_SUBST(HAVE_OSS)
-AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
-
+AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS" = x1 && test "x${oss_output}" != "xno"])
+AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS" = x1 && test "x${oss_wrapper}" != "xno"])
#### ALSA support (optional) ####
@@ -1359,9 +1356,15 @@ if test "x$HAVE_X11" = "x1" ; then
ENABLE_X11=yes
fi
-ENABLE_OSS=no
+ENABLE_OSS_OUTPUT=no
+ENABLE_OSS_WRAPPER=no
if test "x$HAVE_OSS" = "x1" ; then
- ENABLE_OSS=yes
+ if test "x$enable_oss_output" != "xno"; then
+ ENABLE_OSS_OUTPUT=yes
+ fi
+ if test "x$enable_oss_wrapper" != "xno"; then
+ ENABLE_OSS_WRAPPER=yes
+ fi
fi
ENABLE_ALSA=no
@@ -1472,7 +1475,8 @@ echo "
CFLAGS: ${CFLAGS}
Have X11: ${ENABLE_X11}
- Enable OSS: ${ENABLE_OSS}
+ Enable OSS Output: ${ENABLE_OSS_OUTPUT}
+ Enable OSS Wrapper: ${ENABLE_OSS_WRAPPER}
Enable Alsa: ${ENABLE_ALSA}
Enable Solaris: ${ENABLE_SOLARIS}
Enable GLib 2.0: ${ENABLE_GLIB20}
diff --git a/src/Makefile.am b/src/Makefile.am
index c022fa7c..5d711577 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -776,7 +776,7 @@ libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version
# OSS emulation #
###################################
-if HAVE_OSS
+if HAVE_OSS_WRAPPER
lib_LTLIBRARIES += libpulsedsp.la
bin_SCRIPTS += utils/padsp
endif
@@ -1031,7 +1031,7 @@ modlibexec_LTLIBRARIES += \
module-x11-cork-request.la
endif
-if HAVE_OSS
+if HAVE_OSS_OUTPUT
modlibexec_LTLIBRARIES += \
liboss-util.la \
module-oss.la
diff --git a/src/daemon/main.c b/src/daemon/main.c
index b209c514..7a951954 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -113,7 +113,7 @@ int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_WRAPPER
/* padsp looks for this symbol in the running process and disables
* itself if it finds it and it is set to 7 (which is actually a bit
* mask). For details see padsp. */
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 0560ef32..e682997f 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1446,12 +1446,12 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
if (u->sink && dbus_message_is_signal(m, "org.bluez.Headset", "SpeakerGainChanged")) {
pa_cvolume_set(&v, u->sample_spec.channels, (pa_volume_t) (gain * PA_VOLUME_NORM / 15));
- pa_sink_volume_changed(u->sink, &v, TRUE);
+ pa_sink_volume_changed(u->sink, &v);
} else if (u->source && dbus_message_is_signal(m, "org.bluez.Headset", "MicrophoneGainChanged")) {
pa_cvolume_set(&v, u->sample_spec.channels, (pa_volume_t) (gain * PA_VOLUME_NORM / 15));
- pa_source_volume_changed(u->source, &v, TRUE);
+ pa_source_volume_changed(u->source, &v);
}
}
}
diff --git a/src/modules/module-detect.c b/src/modules/module-detect.c
index 18479df3..956fe4c5 100644
--- a/src/modules/module-detect.c
+++ b/src/modules/module-detect.c
@@ -119,7 +119,7 @@ static int detect_alsa(pa_core *c, int just_one) {
}
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
static int detect_oss(pa_core *c, int just_one) {
FILE *f;
int n = 0, b = 0;
@@ -240,7 +240,7 @@ int pa__init(pa_module*m) {
#ifdef HAVE_ALSA
if ((n = detect_alsa(m->core, just_one)) <= 0)
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
if ((n = detect_oss(m->core, just_one)) <= 0)
#endif
#ifdef HAVE_SOLARIS
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index 79758b92..b5b2aaf0 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -55,14 +55,14 @@ PA_MODULE_AUTHOR("Shahms King");
PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers");
PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(TRUE);
-#if defined(HAVE_ALSA) && defined(HAVE_OSS)
+#if defined(HAVE_ALSA) && defined(HAVE_OSS_OUTPUT)
PA_MODULE_USAGE("api=<alsa or oss> "
"tsched=<enable system timer based scheduling mode?>"
"subdevs=<init all subdevices>");
#elif defined(HAVE_ALSA)
PA_MODULE_USAGE("api=<alsa> "
"tsched=<enable system timer based scheduling mode?>");
-#elif defined(HAVE_OSS)
+#elif defined(HAVE_OSS_OUTPUT)
PA_MODULE_USAGE("api=<oss>"
"subdevs=<init all subdevices>");
#endif
@@ -84,7 +84,7 @@ struct userdata {
#ifdef HAVE_ALSA
pa_bool_t use_tsched;
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
pa_bool_t init_subdevs;
#endif
};
@@ -97,7 +97,7 @@ static const char* const valid_modargs[] = {
#ifdef HAVE_ALSA
"tsched",
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
"subdevs",
#endif
NULL
@@ -270,7 +270,7 @@ fail:
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
static pa_bool_t hal_oss_device_is_pcm(LibHalContext *context, const char *udi, pa_bool_t init_subdevices) {
char *class = NULL, *dev = NULL, *e;
@@ -402,7 +402,7 @@ static struct device* hal_device_add(struct userdata *u, const char *udi) {
if (pa_streq(u->capability, CAPABILITY_ALSA))
r = hal_device_load_alsa(u, udi, d);
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
if (pa_streq(u->capability, CAPABILITY_OSS))
r = hal_device_load_oss(u, udi, d);
#endif
@@ -761,7 +761,7 @@ int pa__init(pa_module*m) {
api = pa_modargs_get_value(ma, "api", "oss");
#endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
if (pa_streq(api, "oss"))
u->capability = CAPABILITY_OSS;
#endif
@@ -771,7 +771,7 @@ int pa__init(pa_module*m) {
goto fail;
}
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
if (pa_modargs_get_value_boolean(ma, "subdevs", &u->init_subdevs) < 0) {
pa_log("Failed to parse subdevs argument.");
goto fail;
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 21f4a8f1..b26330c8 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -178,6 +178,9 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state))
return -1;
+ /* Hmm, process any rewind request that might be queued up */
+ pa_sink_process_rewind(u->sink, 0);
+
while (pa_memblockq_peek(u->memblockq, &tchunk) < 0) {
pa_memchunk nchunk;
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 119f5b9f..0b7b9b8f 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -148,6 +148,9 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state))
return -1;
+ /* Hmm, process any rewind request that might be queued up */
+ pa_sink_process_rewind(u->sink, 0);
+
pa_sink_render(u->sink, nbytes, chunk);
return 0;
}
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index f788f660..eaccea4e 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -1165,10 +1165,10 @@ static void sink_input_info_cb(pa_pdispatch *pd, uint32_t command, uint32_t tag
pa_cvolume_equal(&volume, &u->sink->virtual_volume))
return;
- pa_sink_volume_changed(u->sink, &volume, FALSE);
+ pa_sink_volume_changed(u->sink, &volume);
if (u->version >= 11)
- pa_sink_mute_changed(u->sink, mute, FALSE);
+ pa_sink_mute_changed(u->sink, mute);
return;
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index c418d108..93a4742d 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -765,23 +765,22 @@ static pa_time_event* find_next_time_event(pa_mainloop *m) {
static int calc_next_timeout(pa_mainloop *m) {
pa_time_event *t;
- pa_usec_t usec;
+ pa_usec_t clock_now;
if (!m->n_enabled_time_events)
return -1;
- t = find_next_time_event(m);
- pa_assert(t);
+ pa_assert_se(t = find_next_time_event(m));
- if (t->time == 0)
+ if (t->time <= 0)
return 0;
- usec = t->time - pa_rtclock_now();
+ clock_now = pa_rtclock_now();
- if (usec <= 0)
+ if (t->time <= clock_now)
return 0;
- return (int) (usec / 1000); /* in milliseconds */
+ return (int) ((t->time - clock_now) / 1000); /* in milliseconds */
}
static int dispatch_timeout(pa_mainloop *m) {
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index d8f3c7d1..5e9662c2 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -665,11 +665,14 @@ void pa_sink_move_all_fail(pa_queue *q) {
void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
pa_sink_input *i;
void *state = NULL;
+
pa_sink_assert_ref(s);
pa_assert(PA_SINK_IS_LINKED(s->thread_info.state));
/* If nobody requested this and this is actually no real rewind
- * then we can short cut this */
+ * then we can short cut this. Please note that this means that
+ * not all rewind requests triggered upstream will always be
+ * translated in actual requests! */
if (!s->thread_info.rewind_requested && nbytes <= 0)
return;
@@ -682,7 +685,7 @@ void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
if (nbytes > 0)
pa_log_debug("Processing rewind...");
- while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL))) {
+ PA_HASHMAP_FOREACH(i, s->thread_info.inputs, state) {
pa_sink_input_assert_ref(i);
pa_sink_input_process_rewind(i, nbytes);
}
@@ -1386,6 +1389,12 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *s, pa_bool_t force_refresh, pa_boo
s->reference_volume = s->virtual_volume;
+ /* Something got changed in the hardware. It probably
+ * makes sense to save changed hw settings given that hw
+ * volume changes not triggered by PA are almost certainly
+ * done by the user. */
+ s->save_volume = TRUE;
+
if (s->flags & PA_SINK_FLAT_VOLUME)
pa_sink_propagate_flat_volume(s);
@@ -1397,17 +1406,15 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *s, pa_bool_t force_refresh, pa_boo
}
/* Called from main thread */
-void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume, pa_bool_t save) {
+void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume) {
pa_sink_assert_ref(s);
/* The sink implementor may call this if the volume changed to make sure everyone is notified */
- if (pa_cvolume_equal(&s->virtual_volume, new_volume)) {
- s->save_volume = s->save_volume || save;
+ if (pa_cvolume_equal(&s->virtual_volume, new_volume))
return;
- }
s->reference_volume = s->virtual_volume = *new_volume;
- s->save_volume = save;
+ s->save_volume = TRUE;
if (s->flags & PA_SINK_FLAT_VOLUME)
pa_sink_propagate_flat_volume(s);
@@ -1449,6 +1456,8 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
if (old_muted != s->muted) {
+ s->save_muted = TRUE;
+
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
/* Make sure the soft mute status stays in sync */
@@ -1456,22 +1465,21 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
}
}
+
return s->muted;
}
/* Called from main thread */
-void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted, pa_bool_t save) {
+void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted) {
pa_sink_assert_ref(s);
/* The sink implementor may call this if the volume changed to make sure everyone is notified */
- if (s->muted == new_muted) {
- s->save_muted = s->save_muted || save;
+ if (s->muted == new_muted)
return;
- }
s->muted = new_muted;
- s->save_muted = save;
+ s->save_muted = TRUE;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
}
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index d16fcc01..7a8cdaf1 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -267,8 +267,8 @@ void pa_sink_detach(pa_sink *s);
void pa_sink_attach(pa_sink *s);
void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume);
-void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume, pa_bool_t save);
-void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted, pa_bool_t save);
+void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume);
+void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted);
pa_bool_t pa_device_init_description(pa_proplist *p);
pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 74f38bc5..b8af148f 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -592,15 +592,15 @@ void pa_source_process_rewind(pa_source *s, size_t nbytes) {
pa_source_assert_ref(s);
pa_assert(PA_SOURCE_IS_LINKED(s->thread_info.state));
- if (s->thread_info.state == PA_SOURCE_SUSPENDED)
+ if (nbytes <= 0)
return;
- if (nbytes <= 0)
+ if (s->thread_info.state == PA_SOURCE_SUSPENDED)
return;
pa_log_debug("Processing rewind...");
- while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL))) {
+ PA_HASHMAP_FOREACH(o, s->thread_info.outputs, state) {
pa_source_output_assert_ref(o);
pa_source_output_process_rewind(o, nbytes);
}
@@ -773,26 +773,26 @@ const pa_cvolume *pa_source_get_volume(pa_source *s, pa_bool_t force_refresh) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_VOLUME, NULL, 0, NULL) == 0);
- if (!pa_cvolume_equal(&old_virtual_volume, &s->virtual_volume))
+ if (!pa_cvolume_equal(&old_virtual_volume, &s->virtual_volume)) {
+ s->save_volume = TRUE;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+ }
}
return &s->virtual_volume;
}
/* Called from main thread */
-void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume, pa_bool_t save) {
+void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume) {
pa_source_assert_ref(s);
/* The source implementor may call this if the volume changed to make sure everyone is notified */
- if (pa_cvolume_equal(&s->virtual_volume, new_volume)) {
- s->save_volume = s->save_volume || save;
+ if (pa_cvolume_equal(&s->virtual_volume, new_volume))
return;
- }
s->virtual_volume = *new_volume;
- s->save_volume = save;
+ s->save_volume = TRUE;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
}
@@ -831,6 +831,8 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
if (old_muted != s->muted) {
+ s->save_muted = TRUE;
+
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
/* Make sure the soft mute status stays in sync */
@@ -842,18 +844,16 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
}
/* Called from main thread */
-void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted, pa_bool_t save) {
+void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted) {
pa_source_assert_ref(s);
/* The source implementor may call this if the mute state changed to make sure everyone is notified */
- if (s->muted == new_muted) {
- s->save_muted = s->save_muted || save;
+ if (s->muted == new_muted)
return;
- }
s->muted = new_muted;
- s->save_muted = save;
+ s->save_muted = TRUE;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
}
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 7e9fd8b7..d22e7ca5 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -237,8 +237,8 @@ void pa_source_detach(pa_source *s);
void pa_source_attach(pa_source *s);
void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume);
-void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume, pa_bool_t save);
-void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted, pa_bool_t save);
+void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume);
+void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted);
int pa_source_sync_suspend(pa_source *s);
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 3f65cbac..f9f76da3 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -69,6 +69,8 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
break;
}
+ case PA_SAMPLE_S24_32NE:
+ case PA_SAMPLE_S24_32RE:
case PA_SAMPLE_S32NE:
case PA_SAMPLE_S32RE: {
uint32_t *u = d;
@@ -84,7 +86,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
uint8_t *u = d;
for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
- printf("0x%02x%02x%02xx ", *u, *(u+1), *(u+2));
+ printf("0x%02x%02x%02xx ", *u, *(u+1), *(u+2));
u += 3;
}
@@ -125,66 +127,72 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
case PA_SAMPLE_U8:
case PA_SAMPLE_ULAW:
case PA_SAMPLE_ALAW: {
- static const uint8_t u8_samples[] =
- { 0x00, 0xFF, 0x7F, 0x80, 0x9f,
- 0x3f, 0x01, 0xF0, 0x20, 0x21 };
+ static const uint8_t u8_samples[] = {
+ 0x00, 0xFF, 0x7F, 0x80, 0x9f,
+ 0x3f, 0x01, 0xF0, 0x20, 0x21
+ };
- memcpy(d, &u8_samples[0], sizeof(u8_samples));
+ memcpy(d, u8_samples, sizeof(u8_samples));
break;
}
case PA_SAMPLE_S16NE:
case PA_SAMPLE_S16RE: {
- static const uint16_t u16_samples[] =
- { 0x0000, 0xFFFF, 0x7FFF, 0x8000, 0x9fff,
- 0x3fff, 0x0001, 0xF000, 0x0020, 0x0021 };
+ static const uint16_t u16_samples[] = {
+ 0x0000, 0xFFFF, 0x7FFF, 0x8000, 0x9fff,
+ 0x3fff, 0x0001, 0xF000, 0x0020, 0x0021
+ };
- memcpy(d, &u16_samples[0], sizeof(u16_samples));
+ memcpy(d, u16_samples, sizeof(u16_samples));
break;
}
+ case PA_SAMPLE_S24_32NE:
+ case PA_SAMPLE_S24_32RE:
case PA_SAMPLE_S32NE:
case PA_SAMPLE_S32RE: {
- static const uint32_t u32_samples[] =
- { 0x00000001, 0xFFFF0002, 0x7FFF0003, 0x80000004, 0x9fff0005,
- 0x3fff0006, 0x00010007, 0xF0000008, 0x00200009, 0x0021000A };
+ static const uint32_t u32_samples[] = {
+ 0x00000001, 0xFFFF0002, 0x7FFF0003, 0x80000004, 0x9fff0005,
+ 0x3fff0006, 0x00010007, 0xF0000008, 0x00200009, 0x0021000A
+ };
- memcpy(d, &u32_samples[0], sizeof(u32_samples));
+ memcpy(d, u32_samples, sizeof(u32_samples));
break;
}
case PA_SAMPLE_S24NE:
case PA_SAMPLE_S24RE: {
- /* Need to be on a byte array because they are not aligned */
- static const uint8_t u24_samples[] =
- { 0x00, 0x00, 0x01,
- 0xFF, 0xFF, 0x02,
- 0x7F, 0xFF, 0x03,
- 0x80, 0x00, 0x04,
- 0x9f, 0xff, 0x05,
- 0x3f, 0xff, 0x06,
- 0x01, 0x00, 0x07,
- 0xF0, 0x00, 0x08,
- 0x20, 0x00, 0x09,
- 0x21, 0x00, 0x0A };
-
- memcpy(d, &u24_samples[0], sizeof(u24_samples));
+ /* Need to be on a byte array because they are not aligned */
+ static const uint8_t u24_samples[] = {
+ 0x00, 0x00, 0x01,
+ 0xFF, 0xFF, 0x02,
+ 0x7F, 0xFF, 0x03,
+ 0x80, 0x00, 0x04,
+ 0x9f, 0xff, 0x05,
+ 0x3f, 0xff, 0x06,
+ 0x01, 0x00, 0x07,
+ 0xF0, 0x00, 0x08,
+ 0x20, 0x00, 0x09,
+ 0x21, 0x00, 0x0A
+ };
+
+ memcpy(d, u24_samples, sizeof(u24_samples));
break;
}
case PA_SAMPLE_FLOAT32NE:
case PA_SAMPLE_FLOAT32RE: {
float *u = d;
- static const float float_samples[] =
- { 0.0f, -1.0f, 1.0f, 4711.0f, 0.222f,
- 0.33f, -.3f, 99.0f, -0.555f, -.123f };
+ static const float float_samples[] = {
+ 0.0f, -1.0f, 1.0f, 4711.0f, 0.222f,
+ 0.33f, -.3f, 99.0f, -0.555f, -.123f
+ };
if (ss->format == PA_SAMPLE_FLOAT32RE) {
for (i = 0; i < 10; i++)
u[i] = swap_float(float_samples[i]);
- } else {
- memcpy(d, &float_samples[0], sizeof(float_samples));
- }
+ } else
+ memcpy(d, float_samples, sizeof(float_samples));
break;
}