mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-12 05:34:05 -04:00
bluez5: aac: for multiple bits in aot, normalize to mandatory
Non-spec compliant devices may set multiple bits in AAC AOT, which is invalid. In this case, we should normalize to MPEG-2 AAC LC which is the mandatory value in spec, not to MPEG-4 AAC LC. In select_config() we also prefer MPEG-2 over MPEG-4.
This commit is contained in:
parent
5f8ece7017
commit
67b4732c26
1 changed files with 5 additions and 5 deletions
|
|
@ -331,14 +331,14 @@ static void *codec_init(const struct media_codec *codec, uint32_t flags,
|
|||
goto error;
|
||||
|
||||
/* If object type has multiple bits set (invalid per spec, see above),
|
||||
* assume the device usually means AAC-LC.
|
||||
* assume the device usually means MPEG2 AAC LC which is mandatory.
|
||||
*/
|
||||
if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LC) {
|
||||
res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_AAC_LC);
|
||||
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_MPEG2_AAC_LC) {
|
||||
res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_MP2_AAC_LC);
|
||||
} else if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LC) {
|
||||
res = aacEncoder_SetParam(this->aacenc, AACENC_AOT, AOT_AAC_LC);
|
||||
if (res != AACENC_OK)
|
||||
goto error;
|
||||
} else if (conf->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_ELD) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue