summaryrefslogtreecommitdiff
path: root/dom/media
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-02-10 11:09:42 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-30 08:26:12 +0000
commit612b110946e372452c114d832da8e5b6ec951acc (patch)
treee22e91b07b6897a8e19cafa81d1695b598cabb0e /dom/media
parentac6d297268f39c4380a1eb1a38a5278605752c6a (diff)
downloaduxp-612b110946e372452c114d832da8e5b6ec951acc.tar.gz
[DOM media] Adjust lock scope in MediaSourceDemuxer
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/mediasource/MediaSourceDemuxer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/dom/media/mediasource/MediaSourceDemuxer.cpp b/dom/media/mediasource/MediaSourceDemuxer.cpp
index 73950e1a87..616693720a 100644
--- a/dom/media/mediasource/MediaSourceDemuxer.cpp
+++ b/dom/media/mediasource/MediaSourceDemuxer.cpp
@@ -465,10 +465,12 @@ MediaSourceTrackDemuxer::DoGetSamples(int32_t aNumSamples)
}
RefPtr<SamplesHolder> samples = new SamplesHolder;
samples->mSamples.AppendElement(sample);
- if (mNextRandomAccessPoint.ToMicroseconds() <= sample->mTime) {
+ {
MonitorAutoLock mon(mMonitor);
- mNextRandomAccessPoint =
- mManager->GetNextRandomAccessPoint(mType, MediaSourceDemuxer::EOS_FUZZ);
+ if (mNextRandomAccessPoint.ToMicroseconds() <= sample->mTime) {
+ mNextRandomAccessPoint =
+ mManager->GetNextRandomAccessPoint(mType, MediaSourceDemuxer::EOS_FUZZ);
+ }
}
return SamplesPromise::CreateAndResolve(samples, __func__);
}