diff options
author | Michal Ratajsky <[email protected]> | 2015-12-10 00:16:15 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2015-12-10 00:16:15 +0100 |
commit | fd7bf59716421c96a7f7c2c6f3ae60636ef24d3d (patch) | |
tree | 5d25007cdc258d46358bd3eee938495c561c3a15 /backends/pulse/pulse-sink-input.c | |
parent | 461ef5c17262f573c4006010ed421fa364548e19 (diff) | |
download | libmatemixer-fd7bf59716421c96a7f7c2c6f3ae60636ef24d3d.tar.bz2 libmatemixer-fd7bf59716421c96a7f7c2c6f3ae60636ef24d3d.tar.xz |
Require PulseAudio 2.0 or newer
Diffstat (limited to 'backends/pulse/pulse-sink-input.c')
-rw-r--r-- | backends/pulse/pulse-sink-input.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/backends/pulse/pulse-sink-input.c b/backends/pulse/pulse-sink-input.c index eab85b8..af73060 100644 --- a/backends/pulse/pulse-sink-input.c +++ b/backends/pulse/pulse-sink-input.c @@ -82,7 +82,6 @@ pulse_sink_input_new (PulseSink *sink, const pa_sink_input_info *info) * Also make sure to make the name unique by including the PulseAudio index. */ name = g_strdup_printf ("pulse-output-control-%lu", (gulong) info->index); -#if PA_CHECK_VERSION(1, 0, 0) if (info->has_volume) { flags |= MATE_MIXER_STREAM_CONTROL_VOLUME_READABLE | @@ -91,14 +90,6 @@ pulse_sink_input_new (PulseSink *sink, const pa_sink_input_info *info) if (info->volume_writable) flags |= MATE_MIXER_STREAM_CONTROL_VOLUME_WRITABLE; } -#else - /* Pre-1.0 PulseAudio does not include the has_volume and volume_writable - * fields, but does include the volume info, so let's give it a try */ - flags |= - MATE_MIXER_STREAM_CONTROL_VOLUME_READABLE | - MATE_MIXER_STREAM_CONTROL_VOLUME_WRITABLE | - MATE_MIXER_STREAM_CONTROL_HAS_DECIBEL; -#endif if (info->client != PA_INVALID_INDEX) { app_info = _mate_mixer_app_info_new (); @@ -168,17 +159,16 @@ pulse_sink_input_update (PulseSinkInput *input, const pa_sink_input_info *info) _mate_mixer_stream_control_set_mute (MATE_MIXER_STREAM_CONTROL (input), info->mute ? TRUE : FALSE); -#if PA_CHECK_VERSION(1, 0, 0) - pulse_stream_control_set_channel_map (PULSE_STREAM_CONTROL (input), &info->channel_map); - + pulse_stream_control_set_channel_map (PULSE_STREAM_CONTROL (input), + &info->channel_map); if (info->has_volume) - pulse_stream_control_set_cvolume (PULSE_STREAM_CONTROL (input), &info->volume, 0); + pulse_stream_control_set_cvolume (PULSE_STREAM_CONTROL (input), + &info->volume, + 0); else - pulse_stream_control_set_cvolume (PULSE_STREAM_CONTROL (input), NULL, 0); -#else - pulse_stream_control_set_channel_map (PULSE_STREAM_CONTROL (input), &info->channel_map); - pulse_stream_control_set_volume (PULSE_STREAM_CONTROL (input), &info->volume, 0); -#endif + pulse_stream_control_set_cvolume (PULSE_STREAM_CONTROL (input), + NULL, + 0); g_object_thaw_notify (G_OBJECT (input)); } |