Skip to content

Commit

Permalink
Change CircularCache internal pos members from uint64_t to int64_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulion committed Mar 2, 2013
1 parent 87047e9 commit 2c9a421
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions xbmc/filesystem/CircularCache.cpp
Expand Up @@ -169,7 +169,7 @@ int CCircularCache::ReadFromCache(char *buf, size_t len)
int64_t CCircularCache::WaitForData(unsigned int minumum, unsigned int millis)
{
CSingleLock lock(m_sync);
uint64_t avail = m_end - m_cur;
int64_t avail = m_end - m_cur;

if(millis == 0 || IsEndOfInput())
return avail;
Expand All @@ -195,14 +195,14 @@ int64_t CCircularCache::Seek(int64_t pos)

// if seek is a bit over what we have, try to wait a few seconds for the data to be available.
// we try to avoid a (heavy) seek on the source
if ((uint64_t)pos >= m_end && (uint64_t)pos < m_end + 100000)
if (pos >= m_end && pos < m_end + 100000)
{
lock.Leave();
WaitForData((size_t)(pos - m_cur), 5000);
lock.Enter();
}

if((uint64_t)pos >= m_beg && (uint64_t)pos <= m_end)
if(pos >= m_beg && pos <= m_end)
{
m_cur = pos;
return pos;
Expand Down
6 changes: 3 additions & 3 deletions xbmc/filesystem/CircularCache.h
Expand Up @@ -44,9 +44,9 @@ class CCircularCache : public CCacheStrategy
virtual void Reset(int64_t pos) ;

protected:
uint64_t m_beg; /**< index in file (not buffer) of beginning of valid data */
uint64_t m_end; /**< index in file (not buffer) of end of valid data */
uint64_t m_cur; /**< current reading index in file */
int64_t m_beg; /**< index in file (not buffer) of beginning of valid data */
int64_t m_end; /**< index in file (not buffer) of end of valid data */
int64_t m_cur; /**< current reading index in file */
uint8_t *m_buf; /**< buffer holding data */
size_t m_size; /**< size of data buffer used (m_buf) */
size_t m_size_back; /**< guaranteed size of back buffer (actual size can be smaller, or larger if front buffer doesn't need it) */
Expand Down

0 comments on commit 2c9a421

Please sign in to comment.