Bug 1401471. P2 - remove SEEK_AND_RESUME. r=gerald

MozReview-Commit-ID: ACdp3wVuurb

--HG--
extra : rebase_source : 0050aea48b07b406a84d8b33ebcd9bbf33c6c94e
extra : intermediate-source : 7efbc9605b94bfc93b660e673690625dd7ee74a2
extra : source : 315382f4c613b80d6f315c7dd7a36dada99b9d27
This commit is contained in:
JW Wang 2017-09-20 16:16:07 +08:00
Родитель 8de2a1f57f
Коммит bfbcdad5a4
1 изменённых файлов: 6 добавлений и 9 удалений

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

@ -1134,10 +1134,11 @@ MediaCache::Update()
{
NONE,
SEEK,
SEEK_AND_RESUME,
RESUME,
SUSPEND
} mTag = NONE;
// Members for 'SEEK' only.
bool mResume = false;
};
// The action to use for each stream. We store these so we can make
@ -1398,9 +1399,8 @@ MediaCache::Update()
// in mPartialBlockBuffer.
stream->mChannelOffset =
OffsetToBlockIndexUnchecked(desiredOffset) * BLOCK_SIZE;
actions[i].mTag = stream->mCacheSuspended
? StreamAction::SEEK_AND_RESUME
: StreamAction::SEEK;
actions[i].mTag = StreamAction::SEEK;
actions[i].mResume = stream->mCacheSuspended;
// mChannelOffset is updated to a new position. We don't want data from
// the old channel to be written to the wrong position. 0 is a sentinel
// value which will not match any ID passed to NotifyDataReceived().
@ -1431,7 +1431,6 @@ MediaCache::Update()
MediaCacheStream* stream = mStreams[i];
switch (actions[i].mTag) {
case StreamAction::SEEK:
case StreamAction::SEEK_AND_RESUME:
stream->mCacheSuspended = false;
stream->mChannelEnded = false;
break;
@ -1451,14 +1450,12 @@ MediaCache::Update()
nsresult rv;
switch (actions[i].mTag) {
case StreamAction::SEEK:
case StreamAction::SEEK_AND_RESUME:
LOG("Stream %p CacheSeek to %" PRId64 " (resume=%d)",
stream,
stream->mChannelOffset,
actions[i].mTag == StreamAction::SEEK_AND_RESUME);
actions[i].mResume);
rv = stream->mClient->CacheClientSeek(stream->mChannelOffset,
actions[i].mTag ==
StreamAction::SEEK_AND_RESUME);
actions[i].mResume);
break;
case StreamAction::RESUME:
LOG("Stream %p Resumed", stream);