summaryrefslogtreecommitdiff
path: root/src/encoder/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-03 14:22:32 +0200
committerMax Kellermann <max@musicpd.org>2019-04-03 14:22:32 +0200
commitf8570dd79f17f5c9237e83e262d468fa33c1a831 (patch)
tree09aa880a74d844136039e35cae82fdc943e2f1c6 /src/encoder/plugins
parent4a49f3cce857d942b310be76885ff82450360327 (diff)
encoder/opus: use new[] instead of xalloc()
Diffstat (limited to 'src/encoder/plugins')
-rw-r--r--src/encoder/plugins/OpusEncoderPlugin.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/encoder/plugins/OpusEncoderPlugin.cxx b/src/encoder/plugins/OpusEncoderPlugin.cxx
index 64c2aa617..b1da41141 100644
--- a/src/encoder/plugins/OpusEncoderPlugin.cxx
+++ b/src/encoder/plugins/OpusEncoderPlugin.cxx
@@ -21,7 +21,6 @@
#include "OggEncoder.hxx"
#include "AudioFormat.hxx"
#include "config/Domain.hxx"
-#include "util/Alloc.hxx"
#include "util/ByteOrder.hxx"
#include "util/StringUtil.hxx"
@@ -134,7 +133,7 @@ OpusEncoder::OpusEncoder(AudioFormat &_audio_format, ::OpusEncoder *_enc, bool _
frame_size(_audio_format.GetFrameSize()),
buffer_frames(_audio_format.sample_rate / 50),
buffer_size(frame_size * buffer_frames),
- buffer((unsigned char *)xalloc(buffer_size)),
+ buffer(new uint8_t[buffer_size]),
enc(_enc)
{
opus_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&lookahead));
@@ -181,7 +180,7 @@ PreparedOpusEncoder::Open(AudioFormat &audio_format)
OpusEncoder::~OpusEncoder()
{
- free(buffer);
+ delete[] buffer;
opus_encoder_destroy(enc);
}
@@ -325,7 +324,7 @@ OpusEncoder::GenerateTags(const Tag *tag)
}
}
- unsigned char *comments = (unsigned char *)xalloc(comments_size);
+ unsigned char *comments = new unsigned char[comments_size];
unsigned char *p = comments;
memcpy(comments, "OpusTags", 8);
@@ -369,7 +368,7 @@ OpusEncoder::GenerateTags(const Tag *tag)
stream.PacketIn(packet);
Flush();
- free(comments);
+ delete[] comments;
}
void