diff options
author | Max Kellermann <max@duempel.org> | 2010-05-31 09:44:30 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-05-31 10:03:43 +0200 |
commit | 4e080a9b06c3f46b4e92b820f0f087a38fc3940c (patch) | |
tree | 95383e5e736a6eb88a8408e78fc640215f9530a4 | |
parent | d55740808d95f420c2e51c189b1fbdc93c3dda8c (diff) | |
download | mpd-4e080a9b06c3f46b4e92b820f0f087a38fc3940c.tar.gz mpd-4e080a9b06c3f46b4e92b820f0f087a38fc3940c.tar.xz mpd-4e080a9b06c3f46b4e92b820f0f087a38fc3940c.zip |
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).
Diffstat (limited to '')
-rw-r--r-- | src/decoder/gme_decoder_plugin.c | 9 |
1 files 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; } |