mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-02 05:12:02 +00:00
[client] audio: reduce playback startup delay
This commit is contained in:
@@ -1428,13 +1428,12 @@ void audio_playbackData(uint8_t * data, size_t size, uint32_t time)
|
|||||||
if (playbackGetState() == STREAM_STATE_SETUP_SPICE)
|
if (playbackGetState() == STREAM_STATE_SETUP_SPICE)
|
||||||
{
|
{
|
||||||
/* Reserve enough data for the backend's immediate startup pulls while
|
/* Reserve enough data for the backend's immediate startup pulls while
|
||||||
* leaving the requested steady-state target afterwards. Tiny device
|
* leaving the requested steady-state target afterwards. Do not add a
|
||||||
* periods must still cover at least one complete source packet. Wait for
|
* complete source packet to the reserve: it can be much larger than the
|
||||||
* that reserve instead of seeking the reader backwards into stale ring
|
* device period and unnecessarily delays activation by another packet. */
|
||||||
* storage. */
|
|
||||||
audio.playback.targetStartFrames = min(
|
audio.playback.targetStartFrames = min(
|
||||||
ceil(targetBufferFrames) +
|
ceil(targetBufferFrames) +
|
||||||
max(audio.playback.deviceStartFrames, frames),
|
audio.playback.deviceStartFrames,
|
||||||
ringbuffer_getLength(audio.playback.buffer));
|
ringbuffer_getLength(audio.playback.buffer));
|
||||||
if (ringbuffer_getCount(audio.playback.buffer) >=
|
if (ringbuffer_getCount(audio.playback.buffer) >=
|
||||||
audio.playback.targetStartFrames)
|
audio.playback.targetStartFrames)
|
||||||
|
|||||||
Reference in New Issue
Block a user