On 2011/01/25 00:47, Rob <[email protected]> wrote: > Hi all, > > In the most recent (stable and dev - 0.16.*) versions of mpd, when > I've been playing a track with both single and crossfade modes on, at > the end of the current track, the next track will start to fade in. > Then mpd gets to the end of the current track, realises it's in single > mode, and kills the fade in. > > It's been bugging me for a while now, so I had a dig around and came > up with this patch. I'm pretty sure I've patched the wrong part, too > deep into the crossfade code, but it works for me, for now. I was just > wondering if anyone had any advice, as I'm new to looking at mpd's > source, despite having used this excellent player for almost three > years.
Hi Rob, indeed this is the wrong place, because the library crossfade.c should be generic, and must not use global variables from other places. I try to keep MPD code abstract, and each library should not know about the others. That makes it sometimes harder, because you need to think about how one library should talk to the other, but in the end, the code is better and more robust. In this case, the player thread would access a global variable which is "owned" by the main thread, but doesn't lock it (there is no lock for g_playlist because g_playlist is only used by the main thread). Is there a mantis bug report on this problem? If not, please write one. Max ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Musicpd-dev-team mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
