libxmms question/suggestion
"Kara White" <[email protected]>
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Message-ID | <[email protected]> |
I recently upgraded to the 2.6.4 kernel, and found that my OSD plugin was
displaying information every once in a while when nothing had changed
(displaying the volume when I hadn't changed anything, displaying the song
when the same song had been playing, etc). I upgraded to the newest
versions of both xmms and xmms-osd, but the problem still held.
So, upon inspection of the source, I found that libxmms (used for all
xmms_remote calls) typically returns 0 as a default value if it isn't able
to connect to the user-specified xmms instance. Functions
xmms_remote_get_playlist_pos, xmms_remote_get_main_value, and others are
SUPPOSED to return gint, but all call remote_get_gint which actually returns
guint (unsigned), and returns 0 if it's not able to connect to the session:
gint fd, ret = 0;
if ((fd = xmms_connect_to_session(session)) == -1)
return ret;
Thus, if one was to call xmms_remote_get_playlist_pos, and for some reason
or another, the process wasn't able to connect to the xmms instance, it
would return 0, indicating that the first song in the playlist was being
played. What I suggest is either returning -1 (like the function would have
you assume), or setting errno if remote_get_gint fails at
xmms_connect_to_session. As best as I can tell, this is what's happening on
my computer. For some reason or another, through crappy new kernel code,
every once in a while the socket connection to /tmp/xmms_user.0 fails, I get
0 as the playlist position (or volume), it displays this to the screen, and
on the very next call it does connect, I get the proper readings, and it
displays the new _real_ information.
So if anyone has any suggestions for the kernel issue, or the developers
agree that there should be some sort of error handling in libxmms, drop me a
line so I can get this straightened out.
Kara White
_________________________________________________________________
>From must-see cities to the best beaches, plan a getaway with the Spring
Travel Guide! http://special.msn.com/local/springtravel.armx