INNER CODE UNIT · C
read_le32
Cateners/tiny_container · app/src/main/cpp/tiny_audio_jni.c:143
static uint32_t read_le32(const uint8_t *p) { return (uint32_t)p[0]|((uint32_t)p[1]<<8)|((uint32_t)p[2]<<16)|((uint32_t)p[3]<<24); }
static int connect_unix(const char *path)
{
struct sockaddr_un a; int fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd<0) return -1;
memset(&a,0,sizeof(a)); a.sun_family=AF_UNIX;
strncpy(a.sun_path,path,sizeof(a.sun_path)-1);
if (connect(fd,(struct sockaddr*)&a,sizeof(a))<0) { close(fd); return -1; }
LOGI("connected %s",path);
return fd;
}
/* ================================================================= */
/* AAudio output data callback */
/* (AAudio calls this when it needs audio – the only correct way) */
/* ================================================================= */
static aaudio_data_callback_result_t out_cb(