mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
ABuffer: move it and groove it
This commit is contained in:
parent
2df6f0e87f
commit
ed25d524f2
Notes:
sideshowbarker
2024-07-19 13:13:40 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/ed25d524f25 Pull-request: https://github.com/SerenityOS/serenity/pull/322
3 changed files with 4 additions and 4 deletions
|
@ -53,8 +53,8 @@ struct ASample {
|
|||
class ABuffer : public RefCounted<ABuffer> {
|
||||
public:
|
||||
static RefPtr<ABuffer> from_pcm_data(ByteBuffer& data, int num_channels, int bits_per_sample, int source_rate);
|
||||
ABuffer(Vector<ASample>& samples)
|
||||
: m_samples(samples)
|
||||
ABuffer(Vector<ASample>&& samples)
|
||||
: m_samples(move(samples))
|
||||
{}
|
||||
|
||||
const Vector<ASample>& samples() const { return m_samples; }
|
||||
|
|
|
@ -217,5 +217,5 @@ RefPtr<ABuffer> ABuffer::from_pcm_data(ByteBuffer& data, int num_channels, int b
|
|||
// don't belong.
|
||||
ASSERT(!stream.handle_read_failure());
|
||||
|
||||
return adopt(*new ABuffer(fdata));
|
||||
return adopt(*new ABuffer(move(fdata)));
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ bool ASClientConnection::handle_message(const ASAPI_ClientMessage& message, cons
|
|||
reply.playing_buffer.buffer_id = message.play_buffer.buffer_id;
|
||||
post_message(reply);
|
||||
|
||||
m_mixer.queue(*this, adopt(*new ABuffer(samples)));
|
||||
m_mixer.queue(*this, adopt(*new ABuffer(move(samples))));
|
||||
break;
|
||||
}
|
||||
case ASAPI_ClientMessage::Type::Invalid:
|
||||
|
|
Loading…
Add table
Reference in a new issue