wasapi2: Warm up capture audio client on open

If the endpoint is idle, the first IAudioClient::Start() call
may take a long time to return. Start/stop the capture client
on open to reduce latency of subsequent Start() calls.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9553>
This commit is contained in:
Seungha Yang 2025-08-14 03:03:50 +09:00 committed by GStreamer Marge Bot
parent cb7dcff69e
commit 7a48a0036f

View File

@ -887,6 +887,13 @@ gst_wasapi2_device_manager_create_ctx (IMMDeviceEnumerator * enumerator,
}
}
/* Warm up device, first Start() call may take long if device is in idle state */
if (ctx->capture_client && !ctx->dummy_client) {
ctx->client->Start ();
ctx->client->Stop ();
ctx->client->Reset ();
}
ctx->is_default = is_default;
ctx->endpoint_class = endpoint_class;