1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +00:00

Audio: Make ABuffer sit on top of a SharedBuffer.

This allows us to carry the same buffer all the way from the WAV loader
to the AudioServer mixer.

This alleviates some of the stutter, but there's still a noticeable
skip when switching buffers. We're gonna need to do better. :^)
This commit is contained in:
Andreas Kling 2019-07-27 18:17:17 +02:00
parent b805f112c2
commit 5e01dde7b1
6 changed files with 38 additions and 31 deletions

View file

@ -14,16 +14,15 @@ class ASMixer : public RefCounted<ASMixer> {
public:
ASMixer();
void queue(ASClientConnection&, const ABuffer&, int buffer_id);
void queue(ASClientConnection&, const ABuffer&);
private:
struct ASMixerBuffer {
ASMixerBuffer(const NonnullRefPtr<ABuffer>&, ASClientConnection&, int buffer_id = -1);
ASMixerBuffer(const NonnullRefPtr<ABuffer>&, ASClientConnection&);
NonnullRefPtr<ABuffer> buffer;
int pos { 0 };
bool done { false };
WeakPtr<ASClientConnection> m_client;
int m_buffer_id { -1 };
};
Vector<ASMixerBuffer> m_pending_mixing;