am e262a49b: Merge "Fix for b/4279535 Seeking in a video causes it to start form beginning" into honeycomb-mr1
* commit 'e262a49b8dd85317efad07cfe17abc2b71d3caad': Fix for b/4279535 Seeking in a video causes it to start form beginning
This commit is contained in:
@@ -158,8 +158,15 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
bool seekNextSync = false;
|
||||
|
||||
int64_t seekTimeUs;
|
||||
|
||||
int retryLimit = 500; // Limit on number of retries before timeout, 10ms per retry
|
||||
|
||||
ReadOptions::SeekMode mode;
|
||||
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
|
||||
|
||||
// When doing a seek, use a longer timeout since we need to set up a new connection
|
||||
retryLimit = 1500;
|
||||
|
||||
//LOGD("%s seek mode=%d, seek time=%lld lateby=%lld",
|
||||
// (mESSelector == WV_EsSelector_Video) ? "video" : "audio",
|
||||
// mode, seekTimeUs, options->getLateBy());
|
||||
@@ -196,7 +203,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
int64_t keyTime;
|
||||
|
||||
bool syncFrame;
|
||||
int retryLimit = 0;
|
||||
int retryCount = 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
|
||||
@@ -258,7 +265,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
}
|
||||
|
||||
if (bytesRead == 0) {
|
||||
if (retryLimit++ >= 500) {
|
||||
if (retryCount++ >= retryLimit) {
|
||||
// If no data received within the retry limit, return ERROR_IO
|
||||
// This prevents the player from becoming unresponsive
|
||||
mediaBuf->release();
|
||||
|
||||
Reference in New Issue
Block a user