GNOME Bugzilla – Bug 525613
[wildmidi] [PATCH] initializes library multiple times
Last modified: 2008-07-28 22:20:42 UTC
Reported at https://launchpad.net/bugs/208068 gst-plugins-bad 0.10.6 Playing a midi file in Totem works fine, but when it finish it says that I have no codec to play the file. "The playback of this movie requires a audio/midi decoder plugin which is not installed." Sebastian Dröge has told me he believes this is caused by wildmidi reporting a wrong error. To reproduce, play a midi file with Totem, wait until the file is reproduced, and in the end it will popup the error dialog.
I can confirm this with the latest version of gst-plugins-bad version 0.10.7 when using the wildmidi midi playing element. The seems to be because it calls WildMidi_Init(...) each time a song is played, but it should only be called once during the lifetime of the program.
Created attachment 112517 [details] [review] Just a diff file Here is a diff file that fixes this annoying bug. Don't be mad if it isn't good enough for gstreamer's standards. It is obviously for ext/timidity/gstwildmidi.c
Created attachment 112518 [details] [review] new Diff file New Patch that uses diff -u
Thanks, I've committed a similar change to CVS now. I'm initing wildimidi in the plugin initialization now and if it fails don't register the element at all. 2008-06-11 Sebastian Dröge <slomo@circular-chaos.org> Based on a patch by: Sonicadvance1 at GMAIL dot COM * ext/timidity/gstwildmidi.c: (gst_wildmidi_init), (gst_wildmidi_change_state), (plugin_init): * ext/timidity/gstwildmidi.h: Initialize wildmidi only once in the plugin init function instead of once for every instance. The second and following calls to the wildmidi initialization function will fail. Fixes bug #525613. Also don't register the element at all if wildmidi initialization fails.
Can we please get real names and not just an email address? I think it's a bad idea to only have an email address for even trivial patches.