decoder/mpcdec: fix negative shift on fixed-point samples
"There is a bug in fixed-point musepack (musepack_src_r435) playback. In floating-point audio is OK but in fixed audio is distorted. I have made a patch for this"
This commit is contained in:
		
				
					committed by
					
						
						Max Kellermann
					
				
			
			
				
	
			
			
			
						parent
						
							9134169e37
						
					
				
				
					commit
					96033e4b4e
				
			
							
								
								
									
										1
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,6 +1,7 @@
 | 
				
			|||||||
ver 0.15.9 (2009/??/??)
 | 
					ver 0.15.9 (2009/??/??)
 | 
				
			||||||
* decoders:
 | 
					* decoders:
 | 
				
			||||||
  - mad: fix crash when seeking at end of song
 | 
					  - mad: fix crash when seeking at end of song
 | 
				
			||||||
 | 
					  - mpcdec: fix negative shift on fixed-point samples
 | 
				
			||||||
* playlist: fix single+repeat in random mode
 | 
					* playlist: fix single+repeat in random mode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -103,7 +103,7 @@ mpc_to_mpd_sample(MPC_SAMPLE_FORMAT sample)
 | 
				
			|||||||
	const int shift = bits - MPC_FIXED_POINT_SCALE_SHIFT;
 | 
						const int shift = bits - MPC_FIXED_POINT_SCALE_SHIFT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (shift < 0)
 | 
						if (shift < 0)
 | 
				
			||||||
		val = sample << -shift;
 | 
							val = sample >> -shift;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		val = sample << shift;
 | 
							val = sample << shift;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user