diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder/wildmidi_decoder_plugin.c (renamed from src/decoder/wildmidi_plugin.c) | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/decoder/wildmidi_plugin.c b/src/decoder/wildmidi_decoder_plugin.c index b5e9810f9..66e6c61cf 100644 --- a/src/decoder/wildmidi_plugin.c +++ b/src/decoder/wildmidi_decoder_plugin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2009 The Music Player Daemon Project + * Copyright (C) 2003-2010 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,7 +17,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../decoder_api.h" +#include "config.h" +#include "decoder_api.h" #include <glib.h> @@ -58,7 +59,7 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs) { static const struct audio_format audio_format = { .sample_rate = WILDMIDI_SAMPLE_RATE, - .bits = 16, + .format = SAMPLE_FORMAT_S16, .channels = 2, }; midi *wm; @@ -90,10 +91,7 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs) if (len <= 0) break; - cmd = decoder_data(decoder, NULL, buffer, len, - (float)info->current_sample / - (float)WILDMIDI_SAMPLE_RATE, - 0, NULL); + cmd = decoder_data(decoder, NULL, buffer, len, 0); if (cmd == DECODE_COMMAND_SEEK) { unsigned long seek_where = WILDMIDI_SAMPLE_RATE * @@ -116,21 +114,17 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs) static struct tag * wildmidi_tag_dup(const char *path_fs) { - midi *wm; - const struct _WM_Info *info; - struct tag *tag; - - wm = WildMidi_Open(path_fs); + midi *wm = WildMidi_Open(path_fs); if (wm == NULL) return NULL; - info = WildMidi_GetInfo(wm); + const struct _WM_Info *info = WildMidi_GetInfo(wm); if (info == NULL) { WildMidi_Close(wm); return NULL; } - tag = tag_new(); + struct tag *tag = tag_new(); tag->time = info->approx_total_samples / WILDMIDI_SAMPLE_RATE; WildMidi_Close(wm); |