Skip to content
This repository
Browse code

Merge pull request #2300 from ulion/fix_simple_file_cache_seek_wait_d…

…ata_amount

Fix the WaitData amount in CSimpleFileCache::Seek, count from read pos.
  • Loading branch information...
commit a0e6bac9de0b249281226dac4e92810929b2f357 2 parents 54430d3 + ab350c3
ulion authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  xbmc/filesystem/CacheStrategy.cpp
2  xbmc/filesystem/CacheStrategy.cpp
@@ -212,7 +212,7 @@ int64_t CSimpleFileCache::Seek(int64_t iFilePosition)
212 212
   }
213 213
 
214 214
   int64_t nDiff = iTarget - m_nWritePosition;
215  
-  if ( nDiff > 500000 || (nDiff > 0 && WaitForData((unsigned int)nDiff, 5000) == CACHE_RC_TIMEOUT)  ) {
  215
+  if ( nDiff > 500000 || (nDiff > 0 && WaitForData((unsigned int)(iTarget - m_nReadPosition), 5000) == CACHE_RC_TIMEOUT)  ) {
216 216
     CLog::Log(LOGWARNING,"%s - attempt to seek past read data (seek to %"PRId64". max: %"PRId64". reset read pointer. (%"PRId64")", __FUNCTION__, iTarget, m_nWritePosition, iFilePosition);
217 217
     return  CACHE_RC_ERROR;
218 218
   }

0 notes on commit a0e6bac

Please sign in to comment.
Something went wrong with that request. Please try again.