Bug 911052 - Use decoder's IsDataCachedToEndOfResource instead of resource's version. r=cpearce

This commit is contained in:
Matthew Gregan 2013-09-04 15:08:10 +12:00
Родитель 5ab06bd117
Коммит 6fc72a6e69
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -2267,12 +2267,12 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
// data to begin playback, or if we've not downloaded a reasonable
// amount of data inside our buffering time.
TimeDuration elapsed = now - mBufferingStart;
bool isLiveStream = mDecoder->GetResource()->GetLength() == -1;
bool isLiveStream = resource->GetLength() == -1;
if ((isLiveStream || !mDecoder->CanPlayThrough()) &&
elapsed < TimeDuration::FromSeconds(mBufferingWait * mPlaybackRate) &&
(mQuickBuffering ? HasLowDecodedData(QUICK_BUFFERING_LOW_DATA_USECS)
: (GetUndecodedData() < mBufferingWait * mPlaybackRate * USECS_PER_S)) &&
!resource->IsDataCachedToEndOfResource(mDecoder->mDecoderPosition) &&
!mDecoder->IsDataCachedToEndOfResource() &&
!resource->IsSuspended())
{
LOG(PR_LOG_DEBUG,
@ -2516,7 +2516,7 @@ void MediaDecoderStateMachine::AdvanceFrame()
if (mState == DECODER_STATE_DECODING &&
mDecoder->GetState() == MediaDecoder::PLAY_STATE_PLAYING &&
HasLowDecodedData(remainingTime + EXHAUSTED_DATA_MARGIN_USECS) &&
!resource->IsDataCachedToEndOfResource(mDecoder->mDecoderPosition) &&
!mDecoder->IsDataCachedToEndOfResource() &&
!resource->IsSuspended() &&
(JustExitedQuickBuffering() || HasLowUndecodedData()))
{