xbmc/xbmc — pull request #4491 by ruuk (2014-03-30 18:45:27+00:00)
Title: Added optional parameter 'ignoreCache' to xbmc.playSFX()

This allows calling playSFX() on the same file without it using a cached sound.

There are two reasons to do this:

1. For my purposes, I am calling playSFX() many times with different wavs. Currently I have to update the file name every time and delete the old one. It would be much simpler to just use one file name.
2. If I am reading the code correctly, each call to playSFX() stores the sound in a map for later retrieval and cleanup. Most importantly though, I don't see any mechanism that ever clears old entries regularly. This would be fine for normal usage, but when calling it continually as I need to, it ends up just filling memory.

If there is some mechanism I missed that clears this, feel free to point it out. I have a Raspberry Pi user who continually gets out of memory errors when running our TTS addon and I think this is the cause. Even if I'm wrong and this cache is getting cleared, there is no point filling it at all if I don't need to.