kodi-community-addons / plugin.audio.spotify

Unofficial spotify plugin for Kodi
GNU General Public License v3.0
293 stars 102 forks source link

fix for kodi-community-addons/plugin.audio.spotify#90 #124

Closed gbrauen closed 4 years ago

gbrauen commented 4 years ago

Fix for long spotify tracks going silent after 7 or 8 mins. All changes in httpproxy.py.

  1. Cherrypy timeout increased to be greater than the duration of the track being played. Otherwise, player falls out of the read/write loop when time out detected. Default timeout is 300 secs and the session is then cleaned up by a background task which could take 2 or 3 more minutes getting to the reported 7-8 mins.
  2. If timeout does happen, parallel spotty_bin processes could end up running in parallel. Add logic to prevent that.
  3. Tracks, especially long ones, can be fetched as multiple partial chunks. The silence filling loop at the end of the player's read/write process prevents spotty_bin from exiting so a new file chunk can be processed (without allowing parallel spotty_bin threads). Also writes silence to the end of the track - the original problem symptom.

With this fix in place, I've been playing spotify tracks ranging from 1-20 minutes without problem.

Thanks for the work on this plugin. Kodi with this plugin is now my preferred player for integrating my local FLAC lib with spotify!

marcelveldt commented 4 years ago

Sorry for the late reply. I'm very busy atm. Your code looks fine and great that you managed to fix long standing issue, thanks!