mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: softvol - do not set TLV access flags for the switch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									174592280d
								
							
						
					
					
						commit
						24db585dd1
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
					@ -725,11 +725,13 @@ static int add_user_ctl(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo,
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
	unsigned int def_val;
 | 
						unsigned int def_val;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if (svol->max_val == 1)
 | 
						if (svol->max_val == 1) {
 | 
				
			||||||
 | 
							snd_ctl_elem_info_set_read_write(cinfo, 1, 1);
 | 
				
			||||||
		err = snd_ctl_add_boolean_elem_set(svol->ctl, cinfo, 1, count);
 | 
							err = snd_ctl_add_boolean_elem_set(svol->ctl, cinfo, 1, count);
 | 
				
			||||||
	else
 | 
						} else {
 | 
				
			||||||
		err = snd_ctl_add_integer_elem_set(svol->ctl, cinfo, 1, count,
 | 
							err = snd_ctl_add_integer_elem_set(svol->ctl, cinfo, 1, count,
 | 
				
			||||||
						   0, svol->max_val, 0);
 | 
											   0, svol->max_val, 0);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
	if (svol->max_val == 1)
 | 
						if (svol->max_val == 1)
 | 
				
			||||||
| 
						 | 
					@ -817,7 +819,8 @@ static int softvol_load_control(snd_pcm_t *pcm, snd_pcm_softvol_t *svol,
 | 
				
			||||||
				SNDERR("Control %s mismatch", tmp_name);
 | 
									SNDERR("Control %s mismatch", tmp_name);
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			/* reset numid */
 | 
								/* clear cinfo including numid */
 | 
				
			||||||
 | 
								snd_ctl_elem_info_clear(&cinfo);
 | 
				
			||||||
			snd_ctl_elem_info_set_id(&cinfo, ctl_id);
 | 
								snd_ctl_elem_info_set_id(&cinfo, ctl_id);
 | 
				
			||||||
			if ((err = add_user_ctl(svol, &cinfo, cchannels)) < 0) {
 | 
								if ((err = add_user_ctl(svol, &cinfo, cchannels)) < 0) {
 | 
				
			||||||
				SNDERR("Cannot add a control");
 | 
									SNDERR("Cannot add a control");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue