mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	don't divide by zero if no left resp. no right channels are defined
This commit is contained in:
		
							parent
							
								
									67fcc76093
								
							
						
					
					
						commit
						936862362c
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
					@ -424,7 +424,14 @@ static void get_avg_lr(const pa_channel_map *map, const pa_cvolume *v, pa_volume
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (n_left <= 0)
 | 
				
			||||||
 | 
					        *l = PA_VOLUME_NORM;
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
        *l = left / n_left;
 | 
					        *l = left / n_left;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (n_right <= 0)
 | 
				
			||||||
 | 
					        *r = PA_VOLUME_NORM;
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
        *r = right / n_right;
 | 
					        *r = right / n_right;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue