summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index 52af20a..5963fca 100644
--- a/src/command.c
+++ b/src/command.c
@@ -58,6 +58,9 @@ up(struct context *ctx, int key)
{
struct sink_info *sink = NULL;
+ if (!ctx->context_ready)
+ return;
+
if (ctx->chooser_input == SELECTED_SINK &&
ctx->chooser_sink > 0) {
sink = g_list_nth_data(ctx->sink_list, --ctx->chooser_sink);
@@ -74,6 +77,9 @@ down(struct context *ctx, int key)
{
struct sink_info *sink;
+ if (!ctx->context_ready)
+ return;
+
sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink);
if (ctx->chooser_input == (sink_input_len(ctx, sink) - 1) &&
ctx->chooser_sink < (gint) g_list_length(ctx->sink_list)-1) {
@@ -92,6 +98,9 @@ volume_change(struct context *ctx, gboolean volume_increment)
struct sink_input_info *input;
guint32 index;
+ if (!ctx->context_ready)
+ return;
+
sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink);
pa_cvolume volume;
pa_volume_t tmp_vol;
@@ -152,6 +161,9 @@ mute(struct context *ctx, int key)
guint32 index;
gint mute;
+ if (!ctx->context_ready)
+ return;
+
sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink);
pa_operation* (*mute_set) (pa_context*, guint32, int,
pa_context_success_cb_t, void*);
@@ -182,6 +194,9 @@ switch_sink(struct context *ctx, int key)
pa_operation *o;
gint i;
+ if (!ctx->context_ready)
+ return;
+
if (ctx->chooser_input == SELECTED_SINK)
return;
sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink);