From eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 13 Dec 2011 11:16:25 +0100 Subject: command: Assert when chooser input has unexpected value --- src/command.c | 10 ++++++++-- 1 file 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 . */ +#include + #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)); -- cgit