mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-02 19:44:27 +00:00
LibAudio: Fixed stuttery playback of audio
When playing an ABuffer, the count of samples were determined by the size of the SharedBuffer. This caused small pauses of up to 512 samples during the playback, when the size of the shared buffer was rounded up to a multiple of 4096. This problem was amplified by the fact that the AResampleHelper was created every time a new chunk of audio was to be processed, causing inconsistencies in the playback of wav files.
This commit is contained in:
committed by
Andreas Kling
parent
7e97e1c5d9
commit
4c8341d080
@@ -68,6 +68,6 @@ OwnPtr<AudioServer::EnqueueBufferResponse> ASClientConnection::handle(const Audi
|
||||
if (m_queue->is_full())
|
||||
return make<AudioServer::EnqueueBufferResponse>(false);
|
||||
|
||||
m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer));
|
||||
m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer, message.sample_count()));
|
||||
return make<AudioServer::EnqueueBufferResponse>(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user