Backed out changeset 5b9af87e76a9 (bug 1247189)

This commit is contained in:
Sebastian Hengst 2017-10-11 12:45:45 +02:00
Родитель 6479b83569
Коммит 953fafcc3c
2 изменённых файлов: 1 добавлений и 43 удалений

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

@ -211,12 +211,6 @@ MediaSourceDemuxer::DoDetachSourceBuffer(
mVideoTrack = nullptr;
}
}
for (auto& demuxer : mDemuxers) {
if (demuxer->HasManager(aSourceBuffer)) {
demuxer->DetachManager();
}
}
ScanSourceBuffersForContent();
}
@ -351,9 +345,6 @@ MediaSourceTrackDemuxer::Reset()
NS_NewRunnableFunction("MediaSourceTrackDemuxer::Reset", [self]() {
self->mNextSample.reset();
self->mReset = true;
if (!self->mManager) {
return;
}
self->mManager->Seek(self->mType, TimeUnit::Zero(), TimeUnit::Zero());
{
MonitorAutoLock mon(self->mMonitor);
@ -385,9 +376,6 @@ MediaSourceTrackDemuxer::SkipToNextRandomAccessPoint(
media::TimeIntervals
MediaSourceTrackDemuxer::GetBuffered()
{
if (!mManager) {
return media::TimeIntervals();
}
return mManager->Buffered();
}
@ -398,7 +386,7 @@ MediaSourceTrackDemuxer::BreakCycles()
nsCOMPtr<nsIRunnable> task =
NS_NewRunnableFunction("MediaSourceTrackDemuxer::BreakCycles", [self]() {
self->mParent = nullptr;
self->DetachManager();
self->mManager = nullptr;
});
mParent->GetTaskQueue()->Dispatch(task.forget());
}
@ -406,11 +394,6 @@ MediaSourceTrackDemuxer::BreakCycles()
RefPtr<MediaSourceTrackDemuxer::SeekPromise>
MediaSourceTrackDemuxer::DoSeek(const TimeUnit& aTime)
{
if (!mManager) {
return SeekPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("manager is detached.")), __func__);
}
TimeIntervals buffered = mManager->Buffered(mType);
// Fuzz factor represents a +/- threshold. So when seeking it allows the gap
// to be twice as big as the fuzz value. We only want to allow EOS_FUZZ gap.
@ -458,11 +441,6 @@ MediaSourceTrackDemuxer::DoSeek(const TimeUnit& aTime)
RefPtr<MediaSourceTrackDemuxer::SamplesPromise>
MediaSourceTrackDemuxer::DoGetSamples(int32_t aNumSamples)
{
if (!mManager) {
return SamplesPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("manager is detached.")), __func__);
}
if (mReset) {
// If a seek (or reset) was recently performed, we ensure that the data
// we are about to retrieve is still available.
@ -511,11 +489,6 @@ RefPtr<MediaSourceTrackDemuxer::SkipAccessPointPromise>
MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint(
const TimeUnit& aTimeThreadshold)
{
if (!mManager) {
return SkipAccessPointPromise::CreateAndReject(
SkipFailureHolder(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("manager is detached.")), 0), __func__);
}
uint32_t parsed = 0;
// Ensure that the data we are about to skip to is still available.
TimeIntervals buffered = mManager->Buffered(mType);
@ -536,16 +509,4 @@ MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint(
return SkipAccessPointPromise::CreateAndReject(holder, __func__);
}
bool
MediaSourceTrackDemuxer::HasManager(TrackBuffersManager* aManager) const
{
return mManager == aManager;
}
void
MediaSourceTrackDemuxer::DetachManager()
{
mManager = nullptr;
}
} // namespace mozilla

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

@ -116,9 +116,6 @@ public:
return false;
}
bool HasManager(TrackBuffersManager* aManager) const;
void DetachManager();
private:
RefPtr<SeekPromise> DoSeek(const media::TimeUnit& aTime);
RefPtr<SamplesPromise> DoGetSamples(int32_t aNumSamples);