mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: aac: disable Perceptual Noise Substitution for MPEG-2 profile
When the Bluetooth earphones claim to support AAC `MPEG-2 AAC LC` type only, PipeWire encodes audio using MPEG-4 FDK-AAC profile which enables unsupported Perceptual Noise Substitution (PNS) encoder feature. Use AOT_MP2_AAC_LC pseudo-profile which is AOT_AAC_LC with PNS disabled.
This commit is contained in:
		
							parent
							
								
									38a3ebdca1
								
							
						
					
					
						commit
						187df01b5e
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -370,11 +370,14 @@ static void *codec_init(const struct media_codec *codec, uint32_t flags,
 | 
				
			||||||
	/* If object type has multiple bits set (invalid per spec, see above),
 | 
						/* If object type has multiple bits set (invalid per spec, see above),
 | 
				
			||||||
	 * assume the device usually means AAC-LC.
 | 
						 * assume the device usually means AAC-LC.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (conf->object_type & (AAC_OBJECT_TYPE_MPEG2_AAC_LC |
 | 
						if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LC) {
 | 
				
			||||||
						AAC_OBJECT_TYPE_MPEG4_AAC_LC)) {
 | 
					 | 
				
			||||||
		res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_AAC_LC);
 | 
							res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_AAC_LC);
 | 
				
			||||||
		if (res != AACENC_OK)
 | 
							if (res != AACENC_OK)
 | 
				
			||||||
			goto error;
 | 
								goto error;
 | 
				
			||||||
 | 
						} else if (conf->object_type & AAC_OBJECT_TYPE_MPEG2_AAC_LC) {
 | 
				
			||||||
 | 
							res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_MP2_AAC_LC);
 | 
				
			||||||
 | 
							if (res != AACENC_OK)
 | 
				
			||||||
 | 
								goto error;
 | 
				
			||||||
	} else if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_ELD) {
 | 
						} else if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_ELD) {
 | 
				
			||||||
		res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_ER_AAC_ELD);
 | 
							res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_ER_AAC_ELD);
 | 
				
			||||||
		if (res != AACENC_OK)
 | 
							if (res != AACENC_OK)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue