On Sat, Apr 2, 2016 at 2:08 PM, Erik Massop <e...@ixsop.nl> wrote:
> Hi,
>
>
> On Thu, 31 Mar 2016 18:03:18 +0200
> Mehturt <meht...@gmail.com> wrote:
>
>> On Wed, Mar 30, 2016 at 9:29 AM, Mehturt <meht...@gmail.com> wrote:
> ...snip...
>> > Thanks, I was able to get the async part working with some minor 
>> > modifications.
>> > I'm seeing one problem though, when I have my script running, and I
>> > quit xmms2 via "xmms2 quit", I get infinite loop of the following
>> > messages:
>> >
>> >  ******
>> >  * xmmsc_io_in_handle was called although the xmms2 daemon is not connected
>> >  * This is probably an error in the application using libxmmsclient
>> >  ******
>> >
>> > Any idea why?
>> > Thanks a lot for your support.
>
> This is the mainloop trying to see if there are new messages on the
> connection that no longer exists. This is of course doomed to fail.
>
> You should set up a disconnect callback to clean up when the connection
> goes away. In the present program you'll probably want to just quit the
> mainloop, since xmms2 is the mainloop's only purpose. (In bigger
> programs, you could cleanup only the callbacks associated with the
> connection that went away, and show a reconnect dialog or so.)
>
> The attached patch quits the mainloop on disconnect for the previously
> patched tut6.pl.

Thanks, that works fine now.

>
>> And this is what I use at the moment for testing..
>> https://github.com/mehturt/xmms2_lastfm_scrobbler/blob/master/scrobbler.pl
>> Comments welcome.
>
> 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.

Ok, I got that from tut3.pl. I'll have a look later on how to use a
callback there as well.
Thanks.
m.

--
_______________________________________________
Xmms2-devel mailing list
Xmms2-devel@lists.xmms2.org
https://lists.xmms2.org/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to