summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@intel.com>2010-07-16 16:46:28 -0500
committerColin Guthrie <cguthrie@mandriva.org>2010-08-12 18:20:27 +0100
commit9b6c84ad6e572854f199379177226e24c317d0d8 (patch)
tree78f42ead5de58e510b75407e3d1d8e99c15055b3 /src/pulsecore/sink.c
parent021aa306aa614385ff2029fd152008d4f9107414 (diff)
AC3 passthrough support
Second version after Tanu's feedback TODO: - notify client that volume control is disabled - change sink rate in passthrough mode if needed - automatic detection of passthrough mode instead of hard coded profile names Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index d69f0388..b68ad3aa 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1393,6 +1393,24 @@ void pa_sink_set_volume(
pa_assert(volume || (s->flags & PA_SINK_FLAT_VOLUME));
pa_assert(!volume || volume->channels == 1 || pa_cvolume_compatible(volume, &s->sample_spec));
+ /* make sure we don't change the volume when a PASSTHROUGH input is connected */
+ if (s->flags & PA_SINK_PASSTHROUGH) {
+ pa_sink_input *alt_i;
+ uint32_t idx;
+
+ /* one and only one PASSTHROUGH input can possibly be connected */
+ if (pa_idxset_size(s->inputs) == 1) {
+
+ alt_i = pa_idxset_first(s->inputs, &idx);
+
+ if (alt_i->flags & PA_SINK_INPUT_PASSTHROUGH) {
+ /* FIXME: Need to notify client that volume control is disabled */
+ pa_log_warn("Cannot change volume, Sink is connected to PASSTHROUGH input");
+ return;
+ }
+ }
+ }
+
/* As a special exception we accept mono volumes on all sinks --
* even on those with more complex channel maps */