update delay from api
Some checks are pending
C++ CI / build (push) Waiting to run
C++ CI / test (push) Blocked by required conditions
C++ CI / check (push) Blocked by required conditions

This commit is contained in:
wrapper 2025-08-10 10:43:29 +07:00
parent 0e265b5185
commit 065de5f514

View file

@ -354,13 +354,13 @@ AACContext * aac_encode_open(AACSettings info) {
case AAC_HE:
aot = AOT_SBR;
delay = INPUT_DELAY_SBR(info.frameSize == 960 ? CORE_DELAY_LC_960 : CORE_DELAY_LC, info.sampleRate > 48000 ? 1 : 2) + (info.sampleRate > 48000 ? 0 : 4);
delay = INPUT_DELAY_SBR(info.frameSize == 960 ? CORE_DELAY_LC_960 : CORE_DELAY_LC, 2) + 4;
break;
case AAC_HEV2:
if (info.sampleRate > 48000 || info.noChannels != 2) goto fail;
if (info.noChannels != 2) goto fail;
aot = AOT_PS;
delay = INPUT_DELAY_PS(info.frameSize == 960 ? CORE_DELAY_LC_960 : CORE_DELAY_LC, info.sampleRate > 48000 ? 1 : 2);
delay = INPUT_DELAY_PS(info.frameSize == 960 ? CORE_DELAY_LC_960 : CORE_DELAY_LC, 2);
break;
case AAC_LD:
@ -372,13 +372,13 @@ AACContext * aac_encode_open(AACSettings info) {
case AAC_ELD:
if (info.adts) goto fail;
aot = AOT_AAC_ELD;
delay = INPUT_DELAY_ELD_SBR(info.frameSize == 480 ? CORE_DELAY_LD_480 : CORE_DELAY_LD_512, info.sampleRate > 48000 ? 1 : 2) + (info.sampleRate > 48000 ? 0 : 4);
delay = INPUT_DELAY_ELD_SBR(info.frameSize == 480 ? CORE_DELAY_LD_480 : CORE_DELAY_LD_512, 2) + 4;
break;
case AAC_ELDV2:
if (info.adts) goto fail;
aot = AOT_AAC_ELD;
delay = INPUT_DELAY_ELD_SBRV2(info.frameSize == 480 ? CORE_DELAY_LD_480 : CORE_DELAY_LD_512, info.sampleRate >= 27713 ? 2 : 1) + (info.sampleRate >= 27713 ? 4 : 0);
delay = INPUT_DELAY_ELD_SBRV2(info.frameSize == 480 ? CORE_DELAY_LD_480 : CORE_DELAY_LD_512, 2) + 4;
break;
default: