![]() |
Bug recording cache problems - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136) +---- Thread: Bug recording cache problems (/showthread.php?tid=259674) |
recording cache problems - krustyreturns - 2016-02-12 Sorry for a long an detailed post. We have had a long standing, annoying bug in the wmc addon that I am finally able to investigate now that I can compile Kodi again (yeah!). I think its a bug with Kodi, but so far as I know, no other pvr addons have this problem, so maybe it is just something we are doing wrong. That's why am posting here. bug description: When a recording starts in the backend, we trigger a refresh of the recording list in our addon so that kodi lists the new recording. When the recording finishes we refresh the recording list again. The problem is, this new recording is not playable when the user clicks it. It only plays if the user clicks another older recording first. After that, the new recording is playable (or they can restart kodi, that also fixes the new recording). In Kodi I traced it down to this function in File.cpp Code: bool CFile::Open(const CURL& file, const unsigned int flags) The first thing this function does is check to see if the input filepath is in a global directory cache, by calling this code: Code: if (!g_directoryCache.FileExists(url2.Get(), bPathInCache) ) and this is where the playback fails for us. The reason is the new file is not found in whatever this internal directory cache is, so g_directoryCache.FileExists returns false, but the directory path of the file is in the directory cache, so bPathInCache is true - so we get kicked out on the 'return false'. To prove it, I can fix our problem easily by forcing bPathInCache false. So I don't know how this internal directory cache is getting set to the pvr recordings folder and what causes it to not refresh when the backend adds a new file - even though in the addon we are triggering a refresh of the recording list. If no other pvr addons have this problem, I assume we are doing or not doing something in pvr.wmc that is making this happen, but I don't know how either to a) not make our recordings folder part of this internal cache or b) force the internal cache to refresh when a new recording is added. Any insight on this would be greatly appreciated. RE: recording cache problems - advocate99 - 2016-02-12 Hi there, I'm the person who found the bug several years back. I wanted to add a couple of points: 1. In investigating this bug, I found forum messages suggesting that it also affects users of ArgusTV and NextPVR. So, I don't think that its only the ServerWMC add-on. I believe that most people don't leave their machines running 24/7 as I do, and that's probably why there haven't been many reports of this issue. I'm using a dedicated OpenELEC box and I just leave it running 2. I created a bug report on this issue: http://trac.kodi.tv/ticket/16174 3. An "update library" will also solve the problem with respect to the newly added recordings. However, you have to continue doing an update library anytime newly added recordings appear. I'd really love to see this bug fixed, and am still willing to offer a bounty to get it fixed. RE: recording cache problems - krustyreturns - 2016-02-13 I found a hack for the pvr addon that both fixes the cache and illustrates the problem. I insert the code below in the loop that is processing the recordings list returned from the backend. In the code below xRec.strStreamURL is the file path to the recording. Code: if (strlen(xRec.strStreamURL) > 0 && !XBMC->FileExists(xRec.strStreamURL, true/*useCache*/)) // if file does not exists in Kodi's stupid file cache I thought an easier hack would be to use this when the file doesn't exist in the cache: Code: #define READ_NO_CACHE 0x08 but that fails, why? because kodi reports the file doesn't exist. Even though READ_NO_CACHE is defined in File.h as: Code: /* open without caching. regardless to file type. */ So there seems to be no way of opening a new recording from the addon if it doesn't exist in this cache. RE: recording cache problems - advocate99 - 2016-02-14 If you could find some way to force Kodi to update its cache, that would be the easy solution. Sometimes, just going into the Movies or Video section solves the problem as well. RE: recording cache problems - FernetMenta - 2016-02-14 This is your solution: http://forum.kodi.tv/showthread.php?tid=259830 RE: recording cache problems - krustyreturns - 2016-02-14 Interesting. We can run that way now, but we've been telling our users that mode is a workaround for this issue. It always seemed (to me anyway) more straightforward to point kodi at the already recorded files. Thanks for the info. I also think users have said it doesn't solve this issue completely, but based on what I know now, it seems like it should. I'll investigate. RE: recording cache problems - advocate99 - 2016-02-15 That's correct. It does NOT solve the problem completely. Newly added recordings (particularly those in Recording Now) will NOT play until you do at least one Library Update. After you do the Library Update, the problem is totally resolved until you reboot. Once you reboot, the problem will recur until you do a Library Update again. |