Commit 39105f21 authored by Max Kellermann's avatar Max Kellermann

decoder/wildmidi: moved local variable declarations in tag_dup()

parent 4e080a9b
...@@ -110,21 +110,17 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs) ...@@ -110,21 +110,17 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs)
static struct tag * static struct tag *
wildmidi_tag_dup(const char *path_fs) wildmidi_tag_dup(const char *path_fs)
{ {
midi *wm; midi *wm = WildMidi_Open(path_fs);
const struct _WM_Info *info;
struct tag *tag;
wm = WildMidi_Open(path_fs);
if (wm == NULL) if (wm == NULL)
return NULL; return NULL;
info = WildMidi_GetInfo(wm); const struct _WM_Info *info = WildMidi_GetInfo(wm);
if (info == NULL) { if (info == NULL) {
WildMidi_Close(wm); WildMidi_Close(wm);
return NULL; return NULL;
} }
tag = tag_new(); struct tag *tag = tag_new();
tag->time = info->approx_total_samples / WILDMIDI_SAMPLE_RATE; tag->time = info->approx_total_samples / WILDMIDI_SAMPLE_RATE;
WildMidi_Close(wm); WildMidi_Close(wm);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment