File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,10 +193,12 @@ static int hwdep_device_list(snd_ctl_t *ctl)
193193static int card_info (snd_ctl_t * ctl )
194194{
195195 snd_ctl_card_info_t * info ;
196+ snd_ctl_card_components_t * components ;
196197 snd_ctl_elem_list_t * clist ;
197198 int err ;
198199
199200 snd_ctl_card_info_alloca (& info );
201+ snd_ctl_card_components_alloca (& components );
200202 snd_ctl_elem_list_alloca (& clist );
201203
202204 if ((err = snd_ctl_card_info (ctl , info )) < 0 ) {
@@ -211,7 +213,10 @@ static int card_info(snd_ctl_t *ctl)
211213 snd_ctl_card_info_get_longname (info ));
212214 printf (" driver_name: %s\n" , snd_ctl_card_info_get_driver (info ));
213215 printf (" mixer_name: %s\n" , snd_ctl_card_info_get_mixername (info ));
214- printf (" components: %s\n" , snd_ctl_card_info_get_components (info ));
216+ if (snd_ctl_card_components (ctl , components ) >= 0 )
217+ printf (" components: %s\n" , snd_ctl_card_components_get_string (components ));
218+ else
219+ printf (" components: %s\n" , snd_ctl_card_info_get_components (info ));
215220 if ((err = snd_ctl_elem_list (ctl , clist )) < 0 ) {
216221 error ("snd_ctl_elem_list failure: %s" , snd_strerror (err ));
217222 } else {
Original file line number Diff line number Diff line change @@ -94,8 +94,10 @@ static int info(void)
9494 snd_ctl_t * handle ;
9595 snd_mixer_t * mhandle ;
9696 snd_ctl_card_info_t * info ;
97+ snd_ctl_card_components_t * components ;
9798 snd_ctl_elem_list_t * clist ;
9899 snd_ctl_card_info_alloca (& info );
100+ snd_ctl_card_components_alloca (& components );
99101 snd_ctl_elem_list_alloca (& clist );
100102
101103 if ((err = snd_ctl_open (& handle , card , 0 )) < 0 ) {
@@ -110,7 +112,10 @@ static int info(void)
110112 printf ("Card %s '%s'/'%s'\n" , card , snd_ctl_card_info_get_id (info ),
111113 snd_ctl_card_info_get_longname (info ));
112114 printf (" Mixer name : '%s'\n" , snd_ctl_card_info_get_mixername (info ));
113- printf (" Components : '%s'\n" , snd_ctl_card_info_get_components (info ));
115+ if (snd_ctl_card_components (handle , components ) >= 0 )
116+ printf (" Components : '%s'\n" , snd_ctl_card_components_get_string (components ));
117+ else
118+ printf (" Components : '%s'\n" , snd_ctl_card_info_get_components (info ));
114119 if ((err = snd_ctl_elem_list (handle , clist )) < 0 ) {
115120 error ("snd_ctl_elem_list failure: %s" , snd_strerror (err ));
116121 } else {
You can’t perform that action at this time.
0 commit comments