Commit 5b852886 authored by Matthias Drochner's avatar Matthias Drochner Committed by Max Kellermann

mikmod: call MikMod_Exit() only in the finish() method

Hi - independently of libmikmod's other problems - there seems to be a problem in mpd's wrapper: MikMod_Exit() is called after the first file is decoded, which frees some ressources within the mikmod library. An attempt to play a second file leads to a crash. The appended patch fixes this for me. (I don't know what the "dup" entry is good for - someone who knows should review that too.) best regards Matthias [mk: removed 3 more MikMod_Exit() invocations]
parent 02bfb0c4
...@@ -38,6 +38,7 @@ ver 0.14.2 (2009/??/??) ...@@ -38,6 +38,7 @@ ver 0.14.2 (2009/??/??)
* decoders: * decoders:
- ffmpeg: added support for the tags comment, genre, year - ffmpeg: added support for the tags comment, genre, year
- wavpack: pass NULL if the .wvc file fails to open - wavpack: pass NULL if the .wvc file fails to open
- mikmod: call MikMod_Exit() only in the finish() method
* audio outputs: * audio outputs:
- jack: allocate ring buffers before connecting - jack: allocate ring buffers before connecting
- jack: clear "shutdown" flag on reconnect - jack: clear "shutdown" flag on reconnect
......
...@@ -167,7 +167,6 @@ mod_decode(struct decoder *decoder, const char *path) ...@@ -167,7 +167,6 @@ mod_decode(struct decoder *decoder, const char *path)
if (!(data = mod_open(path))) { if (!(data = mod_open(path))) {
g_warning("failed to open mod: %s\n", path); g_warning("failed to open mod: %s\n", path);
MikMod_Exit();
return; return;
} }
...@@ -190,8 +189,6 @@ mod_decode(struct decoder *decoder, const char *path) ...@@ -190,8 +189,6 @@ mod_decode(struct decoder *decoder, const char *path)
} }
mod_close(data); mod_close(data);
MikMod_Exit();
} }
static struct tag *modTagDup(const char *file) static struct tag *modTagDup(const char *file)
...@@ -207,7 +204,6 @@ static struct tag *modTagDup(const char *file) ...@@ -207,7 +204,6 @@ static struct tag *modTagDup(const char *file)
if (moduleHandle == NULL) { if (moduleHandle == NULL) {
g_debug("modTagDup: Failed to open file: %s\n", file); g_debug("modTagDup: Failed to open file: %s\n", file);
MikMod_Exit();
return NULL; return NULL;
} }
...@@ -223,8 +219,6 @@ static struct tag *modTagDup(const char *file) ...@@ -223,8 +219,6 @@ static struct tag *modTagDup(const char *file)
if (title) if (title)
tag_add_item(ret, TAG_ITEM_TITLE, title); tag_add_item(ret, TAG_ITEM_TITLE, title);
MikMod_Exit();
return ret; return ret;
} }
......
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