File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,6 @@ static void audio_cap_jack_probe(struct device_info **available_devices, int *co
116116
117117static void audio_cap_jack_help (const char * client_name )
118118{
119- int count = 0 ;
120- int i = 0 ;
121- struct device_info * available_devices = audio_jack_probe (client_name , JackPortIsOutput , & count );
122-
123119 printf ("Usage:\n" );
124120 printf ("\t-s jack[:first_channel=<f>][:name=<n>][:<device>]\n" );
125121 printf ("\twhere\n" );
@@ -128,7 +124,10 @@ static void audio_cap_jack_help(const char *client_name)
128124 printf ("\n" );
129125
130126 printf ("Available devices:\n" );
131- for (i = 0 ; i < count ; i ++ ){
127+ int count = 0 ;
128+ struct device_info * available_devices =
129+ audio_jack_probe (client_name , JackPortIsOutput , & count );
130+ for (int i = 0 ; i < count ; i ++ ) {
132131 printf ("\t%s\n" , available_devices [i ].name );
133132 }
134133 free (available_devices );
Original file line number Diff line number Diff line change @@ -133,10 +133,6 @@ static void audio_play_jack_probe(struct device_info **available_devices, int *c
133133
134134static void audio_play_jack_help (const char * client_name )
135135{
136- int count = 0 ;
137- int i = 0 ;
138- struct device_info * available_devices = audio_jack_probe (client_name , JackPortIsInput , & count );
139-
140136 printf ("Usage:\n" );
141137 printf ("\t-r jack[:first_channel=<f>][:name=<n>][:<device>]\n" );
142138 printf ("\twhere\n" );
@@ -145,7 +141,10 @@ static void audio_play_jack_help(const char *client_name)
145141 printf ("\n" );
146142
147143 printf ("Available devices:\n" );
148- for (i = 0 ; i < count ; i ++ ){
144+ int count = 0 ;
145+ struct device_info * available_devices =
146+ audio_jack_probe (client_name , JackPortIsInput , & count );
147+ for (int i = 0 ; i < count ; i ++ ) {
149148 printf ("\t%s\n" , available_devices [i ].name );
150149 }
151150 free (available_devices );
You can’t perform that action at this time.
0 commit comments