aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/OpusDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-22 13:37:11 +0100
committerMax Kellermann <max@duempel.org>2014-02-22 13:37:36 +0100
commit5a0dc808fd5f7aea7519a227486a43796fec5538 (patch)
treeaf2066486c725db70716003e3bdd27924dd5f766 /src/decoder/plugins/OpusDecoderPlugin.cxx
parentbefbf6bf13693f9a171da53a3fd124c8ae26c60f (diff)
downloadmpd-5a0dc808fd5f7aea7519a227486a43796fec5538.tar.gz
mpd-5a0dc808fd5f7aea7519a227486a43796fec5538.tar.xz
mpd-5a0dc808fd5f7aea7519a227486a43796fec5538.zip
decoder/opus: use new[] instead of g_malloc()
Diffstat (limited to 'src/decoder/plugins/OpusDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/OpusDecoderPlugin.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx
index d480d1261..67bbe7a54 100644
--- a/src/decoder/plugins/OpusDecoderPlugin.cxx
+++ b/src/decoder/plugins/OpusDecoderPlugin.cxx
@@ -35,8 +35,6 @@
#include <opus.h>
#include <ogg/ogg.h>
-#include <glib.h>
-
#include <string.h>
static constexpr opus_int32 opus_sample_rate = 48000;
@@ -105,7 +103,7 @@ public:
MPDOpusDecoder::~MPDOpusDecoder()
{
- g_free(output_buffer);
+ delete[] output_buffer;
if (opus_decoder != nullptr)
opus_decoder_destroy(opus_decoder);
@@ -270,9 +268,7 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
to hold a quarter second, larger than 120ms required by
libopus */
output_size = audio_format.sample_rate / 4;
- output_buffer = (opus_int16 *)
- g_malloc(sizeof(*output_buffer) * output_size *
- audio_format.channels);
+ output_buffer = new opus_int16[output_size * audio_format.channels];
return decoder_get_command(decoder);
}