Error playing newly added video.

I’ve written my own python script/addon and installed mariaDb on a Raspberry3.

My addon will query the maria database and return a list of video url’s (absolute path) I have stored localy on ‘/home/pi/Videos’. Reading trough this list the addon will use the Player() class to create a video player object and play those videos. (by calling the url or by creating a playlist object and playing that).

When I start Kodi all works perfectly, the script will query the database and start playling the videos (this function is inside a while block, so it will keep reading the database). While Kodi is running another process will start downloading new videos. After a new video is downloaded the mariaDb will be updated so that Kodi will now it has to play a new video. But it will fail!

While trying to play the newly added video it will fail with:

http://pastebin.com/FjTw99Nx

On screen a OKdialog will pop up, announcing “Playback Failed” … check the log for more info….

Tho, if i restart Kodi it will happily play the new video. So the problem occurs when a new video is stored while Kodi itself is working.

Things I’ve tried:
– play video as url
– play video from playlist object
– delete video object after each play and recreate for new play

Things to know :
I start kodi with “taskset -c 0 kodi-standalone” from raspberry console. I am running Raspbian Jessie, Kodi Jarvis installed with apt-get. I’ve set up “gpu_mem=160” in “config.txt”.

Can’t figure out what’s wrong Sad