On Sat, Apr 9, 2016 at 9:33 PM, Erik Massop <e...@ixsop.nl> wrote: > On Mon, 4 Apr 2016 13:13:56 +0200 > Mehturt <meht...@gmail.com> wrote: > >> On Sat, Apr 2, 2016 at 4:53 PM, Mehturt <meht...@gmail.com> wrote: >> > On Sat, Apr 2, 2016 at 2:08 PM, Erik Massop <e...@ixsop.nl> wrote: >> >> In xmms2_current_id you're using $result->wait(). This is problematic, >> >> as wait() does not know what to do when a different result than $result >> >> comes in. You should use a callback also there. >> >> Can you please explain what is the problem here? >> Is it the synchronous call from asynchronous callback? > > The problem is using wait() when there are outstanding async requests > (in this case the current_id broadcast). Wait() assumes that there is > only one response that could possibly come in, namely the one that it is > waiting for. If some else comes in, for instance a message saying that > the current_id changed, it will not be able to handle this. > > I think you should be able to simulate this by sleeping for a while in > xmms2_current_id before calling medialib_get_info and then cycling > through songs rapidly. That way there should be new broadcast messages > lined up before you call medialib_get_info and its ->wait(). Hence > that ->wait() is certain to catch a message that it doesn't expect. > >> Also, can you please point me out to the callback to use here? > > Attached is another patch to tut6.pl, using a callback in the callback.
Thanks a lot, I've now integrated this. m. -- _______________________________________________ Xmms2-devel mailing list Xmms2-devel@lists.xmms2.org https://lists.xmms2.org/cgi-bin/mailman/listinfo/xmms2-devel