am c78c1461: Merge "Partial fix for 4181654 hang in seeking after seeking to the end" into honeycomb-mr1
* commit 'c78c1461df1e5b36374bb6f5a1da2090a5baba88': Partial fix for 4181654 hang in seeking after seeking to the end
This commit is contained in:
@@ -195,6 +195,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
int64_t keyTime;
|
||||
|
||||
bool syncFrame;
|
||||
int retryLimit = 0;
|
||||
|
||||
// Pull full access units. Since we aren't sure how big they might be,
|
||||
// start with initial buffer size, then allocate a larger buffer if we
|
||||
@@ -233,9 +234,16 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
}
|
||||
|
||||
if (bytesRead == 0) {
|
||||
// Didn't get anything, sleep a bit so we don't hog the CPU then try again
|
||||
usleep(10000);
|
||||
continue;
|
||||
if (retryLimit++ >= 500) {
|
||||
// If no data received within the retry limit, return ERROR_IO
|
||||
// This prevents the player from becoming unresponsive
|
||||
mediaBuf->release();
|
||||
return ERROR_IO;
|
||||
} else {
|
||||
// Didn't get anything, sleep a bit so we don't hog the CPU then try again
|
||||
usleep(10000);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
#define PCR_HZ 90000
|
||||
|
||||
Reference in New Issue
Block a user