diff --git a/content/media/ogg/nsOggDecoder.h b/content/media/ogg/nsOggDecoder.h index afe3d4e6a4a..84310670e1a 100644 --- a/content/media/ogg/nsOggDecoder.h +++ b/content/media/ogg/nsOggDecoder.h @@ -44,7 +44,12 @@ class nsOggDecoder : public nsBuiltinDecoder { public: - virtual nsMediaDecoder* Clone() { return new nsOggDecoder(); } + virtual nsMediaDecoder* Clone() { + if (!nsHTMLMediaElement::IsOggEnabled()) { + return nsnull; + } + return new nsOggDecoder(); + } virtual nsDecoderStateMachine* CreateStateMachine(); }; diff --git a/content/media/raw/nsRawDecoder.h b/content/media/raw/nsRawDecoder.h index 029253e897a..fd21a3c8239 100644 --- a/content/media/raw/nsRawDecoder.h +++ b/content/media/raw/nsRawDecoder.h @@ -42,7 +42,12 @@ class nsRawDecoder : public nsBuiltinDecoder { public: - virtual nsMediaDecoder* Clone() { return new nsRawDecoder(); } + virtual nsMediaDecoder* Clone() { + if (!nsHTMLMediaElement::IsRawEnabled()) { + return nsnull; + } + return new nsRawDecoder(); + } virtual nsDecoderStateMachine* CreateStateMachine(); }; diff --git a/content/media/wave/nsWaveDecoder.h b/content/media/wave/nsWaveDecoder.h index 220a6ef21fe..8fbb6bb9e98 100644 --- a/content/media/wave/nsWaveDecoder.h +++ b/content/media/wave/nsWaveDecoder.h @@ -55,8 +55,13 @@ class nsWaveDecoder : public nsBuiltinDecoder { public: - virtual nsMediaDecoder* Clone() { return new nsWaveDecoder(); } - virtual nsDecoderStateMachine* CreateStateMachine(); + virtual nsMediaDecoder* Clone() { + if (!nsHTMLMediaElement::IsWaveEnabled()) { + return nsnull; + } + return new nsWaveDecoder(); + } + virtual nsDecoderStateMachine* CreateStateMachine(); }; #endif diff --git a/content/media/webm/nsWebMDecoder.h b/content/media/webm/nsWebMDecoder.h index ab003dcb73f..a7fb6584636 100644 --- a/content/media/webm/nsWebMDecoder.h +++ b/content/media/webm/nsWebMDecoder.h @@ -44,7 +44,12 @@ class nsWebMDecoder : public nsBuiltinDecoder { public: - virtual nsMediaDecoder* Clone() { return new nsWebMDecoder(); } + virtual nsMediaDecoder* Clone() { + if (!nsHTMLMediaElement::IsWebMEnabled()) { + return nsnull; + } + return new nsWebMDecoder(); + } virtual nsDecoderStateMachine* CreateStateMachine(); };