From f72966589cb57d31235bab46816e6d9549079baa Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 10 Jan 2005 08:25:27 +0000 Subject: [PATCH] fix crashes when selecting an empty view alsamixer would crash when a view without controls was selected --- alsamixer/alsamixer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index 806bc11..369d2d3 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -1926,6 +1926,11 @@ mixer_iteration (void) mixer_view = mixer_view_saved = VIEW_PLAYBACK; mixer_changed_state=1; mixer_reinit (); + if (mixer_n_view_elems == 0) { + mixer_view = mixer_view_saved = VIEW_CAPTURE; + mixer_changed_state=1; + mixer_reinit (); + } } key = 0; break; @@ -1937,6 +1942,11 @@ mixer_iteration (void) mixer_view = mixer_view_saved = VIEW_CAPTURE; mixer_changed_state=1; mixer_reinit (); + if (mixer_n_view_elems == 0) { + mixer_view = mixer_view_saved = VIEW_PLAYBACK; + mixer_changed_state=1; + mixer_reinit (); + } } key = 0; break;