summaryrefslogtreecommitdiff
path: root/Servers/AudioServer
diff options
context:
space:
mode:
authorTill Mayer <till.mayer@web.de>2019-10-16 15:31:01 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-16 16:25:38 +0200
commit4c8341d0806bd86553c1939c9910c1f3f2aff6cf (patch)
treeadecc303fd13a016703282b0b57258a127e8fb01 /Servers/AudioServer
parent7e97e1c5d9adaedf7e4af13021d659371610e4c8 (diff)
downloadserenity-4c8341d0806bd86553c1939c9910c1f3f2aff6cf.zip
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.
Diffstat (limited to 'Servers/AudioServer')
-rw-r--r--Servers/AudioServer/ASClientConnection.cpp2
-rw-r--r--Servers/AudioServer/AudioServer.ipc2
2 files changed, 2 insertions, 2 deletions
diff --git a/Servers/AudioServer/ASClientConnection.cpp b/Servers/AudioServer/ASClientConnection.cpp
index 227de826ef..0ec2b0d13c 100644
--- a/Servers/AudioServer/ASClientConnection.cpp
+++ b/Servers/AudioServer/ASClientConnection.cpp
@@ -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);
}
diff --git a/Servers/AudioServer/AudioServer.ipc b/Servers/AudioServer/AudioServer.ipc
index c2078afeb9..dfad1dd7fa 100644
--- a/Servers/AudioServer/AudioServer.ipc
+++ b/Servers/AudioServer/AudioServer.ipc
@@ -8,5 +8,5 @@ endpoint AudioServer
SetMainMixVolume(i32 volume) => ()
// Buffer playback
- EnqueueBuffer(i32 buffer_id) => (bool success)
+ EnqueueBuffer(i32 buffer_id, int sample_count) => (bool success)
}