diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 2edcfc93da..0a1ecceeb5 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5187,7 +5187,7 @@ void HTMLMediaElement::SetMozPictureInPicture(bool aEnabled)
{
MOZ_ASSERT(NS_IsMainThread());
mPictureInPicture = aEnabled;
- if (mDecoder && !mDecoder->IsShutdown()) {
+ if (mDecoder && !mShuttingDown) {
mDecoder->NotifyOwnerActivityChanged(!IsHidden());
}
}