//
// sub_C1518 from 0xc1518 to 0xc15b6 (158 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:41:49 +0000
//
int __fastcall sub_C1518(int a1)
{
_DWORD *v1; // r6
int State; // r0
int v4; // r1
int v5; // r2
int v6; // r0
int v7; // r8
unsigned int XRunCount; // r0
int BufferCapacityInFrames; // r4
int BufferSizeInFrames; // r8
int FramesPerBurst; // r0
int v12; // r0
int v14; // [sp+4h] [bp-14h] BYREF
v1 = *(_DWORD **)a1;
if ( *(_DWORD *)a1 && v1[1] )
{
sub_BFFC4(&v14);
State = so_AAudioStream_getState(v1[1]);
v4 = v14;
v5 = v1[3];
__dmb(0xBu);
if ( State == 4 )
{
v6 = dword_1262C0;
v7 = v14 - dword_1262C0;
if ( v4 - v5 > 1000 )
{
(*(void (__fastcall **)(int))(a1 + 24))(a1);
v6 = dword_1262C0;
}
if ( v7 > 1000 && v1[8] != v6 )
(*(void (__fastcall **)(int))(a1 + 24))(a1);
}
XRunCount = so_AAudioStream_getXRunCount(v1[1]);
if ( v1[4] < XRunCount )
{
v1[4] = XRunCount;
BufferCapacityInFrames = so_AAudioStream_getBufferCapacityInFrames(v1[1]);
BufferSizeInFrames = so_AAudioStream_getBufferSizeInFrames(v1[1]);
FramesPerBurst = so_AAudioStream_getFramesPerBurst(v1[1]);
if ( BufferSizeInFrames < BufferCapacityInFrames )
{
v12 = FramesPerBurst + BufferSizeInFrames;
if ( v12 < BufferCapacityInFrames )
BufferCapacityInFrames = v12;
so_AAudioStream_setBufferSizeInFrames(v1[1], BufferCapacityInFrames);
}
}
}
return 0;
}