INNER CODE UNIT · C

got

Cateners/tiny_container · app/src/main/cpp/tiny_audio_jni.c:170

    uint32_t got  = ring_read(&g.ring, (uint8_t*)buf, want);

    /* If underrun, pad with silence (zeroes) – memcpy won't touch tail */
    if (got < want)
        memset((uint8_t*)buf + got, 0, want - got);

    return AAUDIO_CALLBACK_RESULT_CONTINUE;
}

static void err_cb(AAudioStream *s, void *ud, aaudio_result_t e)
{
    (void)s; (void)ud;
    if (e == AAUDIO_ERROR_DISCONNECTED) {
        LOGI("AAudio disconnect → restart");
        atomic_store_explicit(&g.aaudio_restart, true, memory_order_release);
    } else LOGE("AAudio err: %d", (int)e);
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…