From 4e080a9b06c3f46b4e92b820f0f087a38fc3940c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2010 09:44:30 +0200 Subject: [PATCH] decoder/gme: replace macro GME_BUF_SIZE Added macros with better names: GME_BUFFER_FRAMES, GME_BUFFER_SAMPLES (the former only used to calculate the latter). --- src/decoder/gme_decoder_plugin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/decoder/gme_decoder_plugin.c b/src/decoder/gme_decoder_plugin.c index 8adf74d66..54947c72c 100644 --- a/src/decoder/gme_decoder_plugin.c +++ b/src/decoder/gme_decoder_plugin.c @@ -8,11 +8,11 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "gme" -#define GME_BUF_SIZE 4096 - enum { GME_SAMPLE_RATE = 44100, GME_CHANNELS = 2, + GME_BUFFER_FRAMES = 2048, + GME_BUFFER_SAMPLES = GME_BUFFER_FRAMES * GME_CHANNELS, }; static void @@ -24,7 +24,7 @@ gme_file_decode(struct decoder *decoder, const char *path_fs) gme_info_t *ti; struct audio_format audio_format; enum decoder_command cmd; - short buf[GME_BUF_SIZE]; + short buf[GME_BUFFER_SAMPLES]; const char* gme_err; gme_err = gme_open_file(path_fs, &emu, GME_SAMPLE_RATE); @@ -62,7 +62,8 @@ gme_file_decode(struct decoder *decoder, const char *path_fs) /* play */ do { - if((gme_err = gme_play(emu, GME_BUF_SIZE, buf)) != NULL){ + gme_err = gme_play(emu, GME_BUFFER_SAMPLES, buf); + if (gme_err != NULL) { g_warning("%s", gme_err); return; }