aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/AdPlugDecoderPlugin.cxx5
-rw-r--r--src/decoder/FluidsynthDecoderPlugin.cxx5
-rw-r--r--src/decoder/MpcdecDecoderPlugin.cxx4
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx3
-rw-r--r--src/decoder/WavpackDecoderPlugin.cxx3
5 files changed, 10 insertions, 10 deletions
diff --git a/src/decoder/AdPlugDecoderPlugin.cxx b/src/decoder/AdPlugDecoderPlugin.cxx
index 3ec48cb23..daac0a740 100644
--- a/src/decoder/AdPlugDecoderPlugin.cxx
+++ b/src/decoder/AdPlugDecoderPlugin.cxx
@@ -23,13 +23,12 @@
#include "DecoderAPI.hxx"
#include "CheckAudioFormat.hxx"
#include "util/Error.hxx"
+#include "util/Macros.hxx"
#include "Log.hxx"
#include <adplug/adplug.h>
#include <adplug/emuopl.h>
-#include <glib.h>
-
#include <assert.h>
static unsigned sample_rate;
@@ -65,7 +64,7 @@ adplug_file_decode(struct decoder *decoder, const char *path_fs)
player->songlength() / 1000.);
int16_t buffer[2048];
- const unsigned frames_per_buffer = G_N_ELEMENTS(buffer) / 2;
+ const unsigned frames_per_buffer = ARRAY_SIZE(buffer) / 2;
DecoderCommand cmd;
do {
diff --git a/src/decoder/FluidsynthDecoderPlugin.cxx b/src/decoder/FluidsynthDecoderPlugin.cxx
index 99f1598c8..5b8909492 100644
--- a/src/decoder/FluidsynthDecoderPlugin.cxx
+++ b/src/decoder/FluidsynthDecoderPlugin.cxx
@@ -23,10 +23,9 @@
#include "CheckAudioFormat.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "util/Macros.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <fluidsynth.h>
static constexpr Domain fluidsynth_domain("fluidsynth");
@@ -171,7 +170,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
DecoderCommand cmd;
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING) {
int16_t buffer[2048];
- const unsigned max_frames = G_N_ELEMENTS(buffer) / 2;
+ const unsigned max_frames = ARRAY_SIZE(buffer) / 2;
/* read samples from fluidsynth and send them to the
MPD core */
diff --git a/src/decoder/MpcdecDecoderPlugin.cxx b/src/decoder/MpcdecDecoderPlugin.cxx
index c0785accc..dd3319831 100644
--- a/src/decoder/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/MpcdecDecoderPlugin.cxx
@@ -25,11 +25,11 @@
#include "tag/TagHandler.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "util/Macros.hxx"
#include "Log.hxx"
#include <mpc/mpcdec.h>
-#include <glib.h>
#include <assert.h>
#include <unistd.h>
#include <math.h>
@@ -212,7 +212,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
mpc_uint32_t ret = frame.samples;
ret *= info.channels;
- int32_t chunk[G_N_ELEMENTS(sample_buffer)];
+ int32_t chunk[ARRAY_SIZE(sample_buffer)];
mpc_to_mpd_buffer(chunk, sample_buffer, ret);
long bit_rate = vbr_update_bits * audio_format.sample_rate
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index 55ce943e8..9ef5e2eea 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -26,6 +26,7 @@
#include "OggCodec.hxx"
#include "util/Error.hxx"
#include "util/UriUtil.hxx"
+#include "util/Macros.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "Log.hxx"
@@ -226,7 +227,7 @@ vorbis_stream_decode(struct decoder *decoder,
#else
float buffer[2048];
const int frames_per_buffer =
- G_N_ELEMENTS(buffer) / audio_format.channels;
+ ARRAY_SIZE(buffer) / audio_format.channels;
const unsigned frame_size = sizeof(buffer[0]) * audio_format.channels;
#endif
diff --git a/src/decoder/WavpackDecoderPlugin.cxx b/src/decoder/WavpackDecoderPlugin.cxx
index 8ee898e30..8c6d9f927 100644
--- a/src/decoder/WavpackDecoderPlugin.cxx
+++ b/src/decoder/WavpackDecoderPlugin.cxx
@@ -26,6 +26,7 @@
#include "tag/ApeTag.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "util/Macros.hxx"
#include "Log.hxx"
#include <wavpack/wavpack.h>
@@ -173,7 +174,7 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
/* wavpack gives us all kind of samples in a 32-bit space */
int32_t chunk[1024];
- const uint32_t samples_requested = G_N_ELEMENTS(chunk) /
+ const uint32_t samples_requested = ARRAY_SIZE(chunk) /
audio_format.channels;
decoder_initialized(decoder, audio_format, can_seek, total_time);