akezeke / spotyxbmc2

spotyXBMC is a fork of XBMC with spotify support
Other
133 stars 29 forks source link

PAPlayer/Audioengine tweaks for spotyxbmc #45

Closed tompen- closed 12 years ago

tompen- commented 12 years ago

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.

akezeke commented 12 years ago

This solution did not fix the problem 100% it seems, most of the time it works to skip to next song and start another one when one is already playing but sometimes the same error occurs!

tompen- commented 12 years ago

When developing the patch, I had the skip to next song working 100%, I tested lots of times and I am sure it worked. It must have been some change I did late after I did these tests. I will try to figure it out.

tompen- commented 12 years ago

I could see the problem and made a fix, a new pull request have been created. I tested with a playlist of approx 200songs and now this works ok for me (on Windows).

akezeke commented 12 years ago

That fix seems to have fixed it! Great work once again!