Backed out changeset 31f6d645e9e5 ("Bug 1269178: P2. Ensure that no skip to next keyframe logic is activated while there's a pending seek. r=gerald")

This commit is contained in:
Jean-Yves Avenard 2016-05-04 15:23:52 +10:00
Родитель cfc3509d01
Коммит aab4c4df00
2 изменённых файлов: 3 добавлений и 13 удалений

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

@ -520,10 +520,7 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
} }
media::TimeUnit timeThreshold{media::TimeUnit::FromMicroseconds(aTimeThreshold)}; media::TimeUnit timeThreshold{media::TimeUnit::FromMicroseconds(aTimeThreshold)};
// Ensure we have no pending seek going as ShouldSkip could return out of date if (ShouldSkip(aSkipToNextKeyframe, timeThreshold)) {
// information.
if (!mVideo.HasInternalSeekPending() &&
ShouldSkip(aSkipToNextKeyframe, timeThreshold)) {
// Cancel any pending demux request. // Cancel any pending demux request.
mVideo.mDemuxRequest.DisconnectIfExists(); mVideo.mDemuxRequest.DisconnectIfExists();
@ -1001,9 +998,6 @@ void
MediaFormatReader::InternalSeek(TrackType aTrack, const InternalSeekTarget& aTarget) MediaFormatReader::InternalSeek(TrackType aTrack, const InternalSeekTarget& aTarget)
{ {
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
LOG("%s internal seek to %f",
TrackTypeToStr(aTrack), aTarget.mTime.ToSeconds());
auto& decoder = GetDecoderData(aTrack); auto& decoder = GetDecoderData(aTrack);
decoder.mTimeThreshold = Some(aTarget); decoder.mTimeThreshold = Some(aTarget);
RefPtr<MediaFormatReader> self = this; RefPtr<MediaFormatReader> self = this;
@ -1281,6 +1275,8 @@ MediaFormatReader::ResetDecode()
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
LOGV(""); LOGV("");
mAudio.mSeekRequest.DisconnectIfExists();
mVideo.mSeekRequest.DisconnectIfExists();
mSeekPromise.RejectIfExists(NS_OK, __func__); mSeekPromise.RejectIfExists(NS_OK, __func__);
mSkipRequest.DisconnectIfExists(); mSkipRequest.DisconnectIfExists();

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

@ -330,7 +330,6 @@ private:
{ {
// Clear demuxer related data. // Clear demuxer related data.
mDemuxRequest.DisconnectIfExists(); mDemuxRequest.DisconnectIfExists();
mSeekRequest.DisconnectIfExists();
mTrackDemuxer->Reset(); mTrackDemuxer->Reset();
} }
@ -357,11 +356,6 @@ private:
mNextStreamSourceID.reset(); mNextStreamSourceID.reset();
} }
bool HasInternalSeekPending() const
{
return mTimeThreshold && !mTimeThreshold.ref().mHasSeeked;
}
// Used by the MDSM for logging purposes. // Used by the MDSM for logging purposes.
Atomic<size_t> mSizeOfQueue; Atomic<size_t> mSizeOfQueue;
// Used by the MDSM to determine if video decoding is hardware accelerated. // Used by the MDSM to determine if video decoding is hardware accelerated.