mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	try more things to get a proper icon for sinks/sources
This commit is contained in:
		
							parent
							
								
									656fc6660f
								
							
						
					
					
						commit
						6427c70a85
					
				
					 1 changed files with 14 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1902,7 +1902,7 @@ size_t pa_sink_get_max_request(pa_sink *s) {
 | 
			
		|||
 | 
			
		||||
/* Called from main context */
 | 
			
		||||
pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
 | 
			
		||||
    const char *ff, *t = NULL, *s = "", *profile, *bus;
 | 
			
		||||
    const char *ff, *c, *t = NULL, *s = "", *profile, *bus;
 | 
			
		||||
 | 
			
		||||
    pa_assert(p);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1919,8 +1919,15 @@ pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
 | 
			
		|||
            t = "computer";
 | 
			
		||||
        else if (pa_streq(ff, "handset"))
 | 
			
		||||
            t = "phone";
 | 
			
		||||
        else if (pa_streq(ff, "portable"))
 | 
			
		||||
            t = "multimedia-player";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!t)
 | 
			
		||||
        if ((c = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
 | 
			
		||||
            if (pa_streq(c, "modem"))
 | 
			
		||||
                t = "modem";
 | 
			
		||||
 | 
			
		||||
    if (!t) {
 | 
			
		||||
        if (is_sink)
 | 
			
		||||
            t = "audio-card";
 | 
			
		||||
| 
						 | 
				
			
			@ -1957,6 +1964,12 @@ pa_bool_t pa_device_init_description(pa_proplist *p) {
 | 
			
		|||
            return TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
 | 
			
		||||
        if (pa_streq(s, "modem")) {
 | 
			
		||||
            pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Modem"));
 | 
			
		||||
            return TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME))) {
 | 
			
		||||
        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
 | 
			
		||||
        return TRUE;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue