diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-13 11:16:25 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-13 16:30:37 +0100 |
commit | eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6 (patch) | |
tree | e6c110dae3c65e13898608fc446f9e8002a0b279 | |
parent | 1e064f8a0a3e3c5d9b8b3cf3f2faf65f4ca55b66 (diff) | |
download | pa-sink-ctl-eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6.tar.gz pa-sink-ctl-eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6.tar.bz2 pa-sink-ctl-eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6.zip |
command: Assert when chooser input has unexpected value
-rw-r--r-- | src/command.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c index 0491831..db131e4 100644 --- a/src/command.c +++ b/src/command.c @@ -17,6 +17,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <glib.h> + #include "pa-sink-ctl.h" #include "interface.h" #include "sink.h" @@ -111,8 +113,10 @@ volume_change(struct context *ctx, gboolean volume_increment) volume = (pa_cvolume) { .channels = sink->channels }; tmp_vol = sink->vol; volume_set = pa_context_set_sink_volume_by_index; - } else + } else { + g_assert(0); return; + } pa_cvolume_set(&volume, volume.channels, tmp_vol); pa_volume_t inc = 2 * PA_VOLUME_NORM / 100; @@ -165,8 +169,10 @@ mute(struct context *ctx, int key) index = sink->index; mute = !sink->mute; mute_set = pa_context_set_sink_mute_by_index; - } else + } else { + g_assert(0); return; + } pa_operation_unref(mute_set(ctx->context, index, mute, change_callback, ctx)); |