Bug 1920800 Remove unnecessary ClearCurrentFrame() r=pehrsons

This was never called because `SetCurrentFrame()` callers all pass non-null
aImage, but the logic is retained.

Differential Revision: https://phabricator.services.mozilla.com/D223921
This commit is contained in:
Karl Tomlinson 2024-09-30 04:07:10 +00:00
parent 43a54cc126
commit f1da5a8f8b
2 changed files with 3 additions and 9 deletions

View File

@ -102,15 +102,13 @@ void VideoFrameContainer::SetCurrentFrame(
#ifdef MOZ_WIDGET_ANDROID
NotifySetCurrent(aImage);
#endif
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
if (aImage) {
MutexAutoLock lock(mMutex);
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
imageList.AppendElement(ImageContainer::NonOwningImage(
aImage, aTargetTime, ++mFrameID, 0, aProcessingDuration, aMediaTime));
SetCurrentFramesLocked(aIntrinsicSize, imageList);
} else {
ClearCurrentFrame(aIntrinsicSize);
}
MutexAutoLock lock(mMutex);
SetCurrentFramesLocked(aIntrinsicSize, imageList);
}
void VideoFrameContainer::SetCurrentFrames(

View File

@ -59,10 +59,6 @@ class VideoFrameContainer {
void SetCurrentFrames(
const gfx::IntSize& aIntrinsicSize,
const nsTArray<ImageContainer::NonOwningImage>& aImages);
void ClearCurrentFrame(const gfx::IntSize& aIntrinsicSize) {
SetCurrentFrames(aIntrinsicSize,
nsTArray<ImageContainer::NonOwningImage>());
}
// Make the current frame the only frame in the container, i.e. discard
// all future frames.