In FileRar.cpp (xbmc Eden) this block of code:
Code:
// perform 'noidx' check
CFileInfo* pFile = g_RarManager.GetFileInRar(m_strRarPath,m_strPathInRar);
if (pFile)
{
if (pFile->m_iIsSeekable == -1)
{
if (Seek(-1,SEEK_END) == -1)
{
m_bSeekable = false;
pFile->m_iIsSeekable = 0;
}
}
else
m_bSeekable = (pFile->m_iIsSeekable == 1);
}
return true;should be replaced with this:
Code:
// perform 'noidx' check
if (Seek(-1,SEEK_END) == -1)
{
m_bSeekable = false;
}
//The Seek() call leaves things in the wrong state
//This is an easy (but not efficient) way to get things back as they should be
CleanUp();
OpenInArchive();
return true;Based on my testing, the call to g_RarManager.GetFileInRar() always returns NULL, even though the file exists in the rar and regardless of whether the rar set is complete. This change finds out if the file is seekable using a different method (just call Seek). The call to Seek either leaves you at the end of the file (wrong place), or returns an error (leaving the file a bad state). The calls to CleanUp() and OpenInArchive() put things back how they were before the call to Seek() in either case. The return values aren't checked because both of these functions had to be successful immediately prior to this in order to get to this point, but it would be better if the return values were checked here as well. I hope someone finds this useful, but if not at least I have it working for my own use
. Thanks.


![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)
Search
Help