mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-15 01:56:40 +02:00
Pass encoded chunks as shared_ptr
This commit is contained in:
parent
d9d403d729
commit
63ad64dfff
10 changed files with 15 additions and 21 deletions
|
@ -227,7 +227,7 @@ void OpusEncoder::encode(const SampleFormat& format, const char* data, size_t si
|
|||
if (len > 0)
|
||||
{
|
||||
// copy encoded data to chunk
|
||||
auto* opusChunk = new msg::PcmChunk(format, 0);
|
||||
auto opusChunk = make_shared<msg::PcmChunk>(format, 0);
|
||||
opusChunk->payloadSize = len;
|
||||
opusChunk->payload = (char*)realloc(opusChunk->payload, opusChunk->payloadSize);
|
||||
memcpy(opusChunk->payload, encoded_.data(), len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue