akezeke/spotyxbmc2 — pull request #45 by tompen- (2012-07-21 14:36:16+00:00)
Title: PAPlayer/Audioengine tweaks for spotyxbmc

This pull request fixes the following issues:

1)
In xbmc.log
CAudioDecoder: Unable to Init Codec while loading file

and

QueueNextFileEx - Failed to create the decoder

2)
The last 5 seconds of spotify songs was never played.
PAplayer attempted to cache next song, but spotify codec already does that internally.
Because spotify codec only allow one stream at any given time, the caching start aborted the currently played song.

3)
Clicking skipnext to start the next song in a playlist did not work. This occured because PAplayer wanted to open a new stream before the other stream was closed.

4)
When user had crossfade enabled, xbmc behaved strange.
Now PAplayer internally disables crossfade only for spotify songs so XBMC will not crossfade spotify songs even when user have this setting enabled. Other media will still crossfade. Crossfading does not work with spotify songs because spotify codec only allows one open stream at any given time.

If crossfading ever gets implemented in spotyxbmc, see issue 12, this pull request should be reverted.
https://github.com/akezeke/spotyxbmc2/issues/12

Basically, since the audioengine merge, PAplayer always mixes streams with a small overlap of 80ms (crossfading). Difference in PAplayer when user have enabled crossfade is the crossfading time gets much longer (seconds). So this pull request is needed because we hit issue 12 all the time.