@@ -64,6 +64,21 @@ void deprecated_register_soundhw(const char *name, const char *descr,
64
64
soundhw_count ++ ;
65
65
}
66
66
67
+ void show_valid_soundhw (void )
68
+ {
69
+ struct soundhw * c ;
70
+
71
+ if (soundhw_count ) {
72
+ printf ("Valid sound card names (comma separated):\n" );
73
+ for (c = soundhw ; c -> name ; ++ c ) {
74
+ printf ("%-11s %s\n" , c -> name , c -> descr );
75
+ }
76
+ } else {
77
+ printf ("Machine has no user-selectable audio hardware "
78
+ "(it may or may not have always-present audio hardware).\n" );
79
+ }
80
+ }
81
+
67
82
static struct soundhw * selected = NULL ;
68
83
69
84
void select_soundhw (const char * optarg )
@@ -75,19 +90,8 @@ void select_soundhw(const char *optarg)
75
90
}
76
91
77
92
if (is_help_option (optarg )) {
78
- show_valid_cards :
79
-
80
- if (soundhw_count ) {
81
- printf ("Valid sound card names (comma separated):\n" );
82
- for (c = soundhw ; c -> name ; ++ c ) {
83
- printf ("%-11s %s\n" , c -> name , c -> descr );
84
- }
85
- printf ("\n-soundhw all will enable all of the above\n" );
86
- } else {
87
- printf ("Machine has no user-selectable audio hardware "
88
- "(it may or may not have always-present audio hardware).\n" );
89
- }
90
- exit (!is_help_option (optarg ));
93
+ show_valid_soundhw ();
94
+ exit (0 );
91
95
}
92
96
else {
93
97
for (c = soundhw ; c -> name ; ++ c ) {
@@ -99,7 +103,8 @@ void select_soundhw(const char *optarg)
99
103
100
104
if (!c -> name ) {
101
105
error_report ("Unknown sound card name `%s'" , optarg );
102
- goto show_valid_cards ;
106
+ show_valid_soundhw ();
107
+ exit (1 );
103
108
}
104
109
}
105
110
}
0 commit comments