# HG changeset patch
# Parent 1f42487f977bd0bc202672d1b931fdacad87fb33

diff --git a/dom/media/DecoderTraits.cpp b/dom/media/DecoderTraits.cpp
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -5,18 +5,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DecoderTraits.h"
 #include "MediaDecoder.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsMimeTypes.h"
 #include "mozilla/Preferences.h"
 
+#ifdef MOZ_WEBM
 #include "OggDecoder.h"
 #include "OggReader.h"
+#endif
 #ifdef MOZ_WAVE
 #include "WaveDecoder.h"
 #include "WaveReader.h"
 #endif
 #ifdef MOZ_WEBM
 #include "WebMDecoder.h"
 #include "WebMReader.h"
 #include "WebMDemuxer.h"
@@ -115,25 +117,27 @@ static char const *const gOggCodecs[3] =
 
 static char const *const gOggCodecsWithOpus[4] = {
   "vorbis",
   "opus",
   "theora",
   nullptr
 };
 
+#ifdef MOZ_WEBM
 static bool
 IsOggType(const nsACString& aType)
 {
   if (!MediaDecoder::IsOggEnabled()) {
     return false;
   }
 
   return CodecListContains(gOggTypes, aType);
 }
+#endif
 
 #ifdef MOZ_WAVE
 // See http://www.rfc-editor.org/rfc/rfc2361.txt for the definitions
 // of WAVE media types and codec types. However, the audio/vnd.wave
 // MIME type described there is not used.
 static const char* const gWaveTypes[5] = {
   "audio/x-wav",
   "audio/wav",
@@ -190,18 +194,20 @@ static bool
 IsGStreamerSupportedType(const nsACString& aMimeType)
 {
   if (DecoderTraits::IsWebMTypeAndEnabled(aMimeType))
     return false;
 
   if (!MediaDecoder::IsGStreamerEnabled())
     return false;
 
+#ifdef MOZ_WEBM
   if (IsOggType(aMimeType) && !Preferences::GetBool("media.prefer-gstreamer", false))
     return false;
+#endif
 
   return GStreamerDecoder::CanHandleMediaType(aMimeType, nullptr);
 }
 #endif
 
 #ifdef MOZ_OMX_DECODER
 static const char* const gOmxTypes[] = {
   "audio/mpeg",
@@ -400,19 +406,21 @@ DecoderTraits::CanHandleCodecsType(const
                                    const nsAString& aRequestedCodecs)
 {
   char const* const* codecList = nullptr;
 #ifdef MOZ_RAW
   if (IsRawType(nsDependentCString(aMIMEType))) {
     codecList = gRawCodecs;
   }
 #endif
+#ifdef MOZ_WEBM
   if (IsOggType(nsDependentCString(aMIMEType))) {
     codecList = MediaDecoder::IsOpusEnabled() ? gOggCodecsWithOpus : gOggCodecs;
   }
+#endif
 #ifdef MOZ_WAVE
   if (IsWaveType(nsDependentCString(aMIMEType))) {
     codecList = gWaveCodecs;
   }
 #endif
 #if !defined(MOZ_OMX_WEBM_DECODER)
   if (IsWebMTypeAndEnabled(nsDependentCString(aMIMEType))) {
     if (IsWebMSupportedType(nsDependentCString(aMIMEType), aRequestedCodecs)) {
@@ -502,19 +510,21 @@ DecoderTraits::CanHandleMediaType(const 
       return result;
     }
   }
 #ifdef MOZ_RAW
   if (IsRawType(nsDependentCString(aMIMEType))) {
     return CANPLAY_MAYBE;
   }
 #endif
+#ifdef MOZ_WEBM
   if (IsOggType(nsDependentCString(aMIMEType))) {
     return CANPLAY_MAYBE;
   }
+#endif
 #ifdef MOZ_WAVE
   if (IsWaveType(nsDependentCString(aMIMEType))) {
     return CANPLAY_MAYBE;
   }
 #endif
   if (IsMP4TypeAndEnabled(nsDependentCString(aMIMEType))) {
     return CANPLAY_MAYBE;
   }
@@ -588,20 +598,22 @@ InstantiateDecoder(const nsACString& aTy
   }
 #endif
 #ifdef MOZ_RAW
   if (IsRawType(aType)) {
     decoder = new RawDecoder(aOwner);
     return decoder.forget();
   }
 #endif
+#ifdef MOZ_WEBM
   if (IsOggType(aType)) {
     decoder = new OggDecoder(aOwner);
     return decoder.forget();
   }
+#endif
 #ifdef MOZ_WAVE
   if (IsWaveType(aType)) {
     decoder = new WaveDecoder(aOwner);
     return decoder.forget();
   }
 #endif
 #ifdef MOZ_OMX_DECODER
   if (IsOmxSupportedType(aType)) {
@@ -688,19 +700,21 @@ MediaDecoderReader* DecoderTraits::Creat
     decoderReader = new GStreamerReader(aDecoder);
   } else
 #endif
 #ifdef MOZ_RAW
   if (IsRawType(aType)) {
     decoderReader = new RawReader(aDecoder);
   } else
 #endif
+#ifdef MOZ_WEBM
   if (IsOggType(aType)) {
     decoderReader = new OggReader(aDecoder);
   } else
+#endif
 #ifdef MOZ_WAVE
   if (IsWaveType(aType)) {
     decoderReader = new WaveReader(aDecoder);
   } else
 #endif
 #ifdef MOZ_OMX_DECODER
   if (IsOmxSupportedType(aType)) {
     decoderReader = new MediaOmxReader(aDecoder);
@@ -736,17 +750,19 @@ bool DecoderTraits::IsSupportedInVideoDo
   // not to, using either the legacy WMF specific pref, or the newer
   // catch-all pref.
   if (!Preferences::GetBool("media.windows-media-foundation.play-stand-alone", true) ||
       !Preferences::GetBool("media.play-stand-alone", true)) {
     return false;
   }
 
   return
+#ifdef MOZ_WEBM
     IsOggType(aType) ||
+#endif
 #ifdef MOZ_OMX_DECODER
     // We support the formats in gB2GOnlyTypes only inside WebApps on firefoxOS
     // but not in general web content. Ensure we dont create a VideoDocument
     // when accessing those format URLs directly.
     (IsOmxSupportedType(aType) &&
      !IsB2GSupportOnlyType(aType)) ||
 #endif
 #ifdef MOZ_WEBM
