mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Changes for pa_modargs_get_value_u32 for integer arguments and correct some error messages
This commit is contained in:
		
							parent
							
								
									0396a60529
								
							
						
					
					
						commit
						aa310a40f8
					
				
					 1 changed files with 4 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -729,7 +729,7 @@ int pa__init(pa_module* m) {
 | 
			
		|||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    if (!(u->name = pa_xstrdup(pa_modargs_get_value(ma, "name", DEFAULT_SINK_NAME)))) {
 | 
			
		||||
        pa_log_error("failed to get device address from module arguments");
 | 
			
		||||
        pa_log_error("failed to get device name from module arguments");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    if (!(u->addr = pa_xstrdup(pa_modargs_get_value(ma, "addr", NULL)))) {
 | 
			
		||||
| 
						 | 
				
			
			@ -740,16 +740,14 @@ int pa__init(pa_module* m) {
 | 
			
		|||
        pa_log_error("failed to get profile from module arguments");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    if (!(rate = pa_modargs_get_value(ma, "rate", NULL))) {
 | 
			
		||||
    if (pa_modargs_get_value_u32(ma, "rate", &u->rate) < 0) {
 | 
			
		||||
        pa_log_error("failed to get rate from module arguments");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    u->rate = atoi(rate);
 | 
			
		||||
    if (!(channels = pa_modargs_get_value(ma, "channels", NULL))) {
 | 
			
		||||
        pa_log_error("failed to get profile from module arguments");
 | 
			
		||||
    if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0) {
 | 
			
		||||
        pa_log_error("failed to get channels from module arguments");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    u->channels = atoi(channels);
 | 
			
		||||
    pa_log("Loading module-bt-device for %s (%s), profile %s", u->name, u->addr, u->profile);
 | 
			
		||||
 | 
			
		||||
    /* connect to the bluez audio service */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue