Bug 935349 - Remove remaining disabled DASH code. r=doublec
authorMatthew Gregan <kinetik@flim.org>
Thu, 07 Nov 2013 17:08:42 +1300
changeset 153906 2dae9a04d903687e6036cb4decefb0067625fe63
parent 153905 f34eba861b9dee7c8eb6c9628dc38075cc552ca0
child 153907 39c53dd62a95679426aef435274f7816409695ca
push id35930
push usermgregan@mozilla.com
push dateThu, 07 Nov 2013 04:38:47 +0000
treeherdermozilla-inbound@2dae9a04d903 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs935349
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 935349 - Remove remaining disabled DASH code. r=doublec
content/media/BufferMediaResource.h
content/media/DecoderTraits.cpp
content/media/MediaDecoder.cpp
content/media/MediaDecoder.h
content/media/MediaDecoderReader.h
content/media/MediaDecoderStateMachine.cpp
content/media/MediaResource.cpp
content/media/MediaResource.h
content/media/test/Makefile.in
content/media/test/test_can_play_type_dash.html
content/media/test/test_can_play_type_no_dash.html
content/media/test/test_dash_detect_stream_switch.html
content/media/webm/Makefile.in
content/media/webm/WebMReader.cpp
content/media/webm/WebMReader.h
--- a/content/media/BufferMediaResource.h
+++ b/content/media/BufferMediaResource.h
@@ -124,24 +124,16 @@ public:
     return NS_OK;
   }
 
   virtual nsresult Open(nsIStreamListener** aStreamListener)
   {
     return NS_ERROR_FAILURE;
   }
 
-#ifdef MOZ_DASH
-  virtual nsresult OpenByteRange(nsIStreamListener** aStreamListener,
-                                 MediaByteRange const &aByteRange)
-  {
-    return NS_ERROR_FAILURE;
-  }
-#endif
-
   virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges)
   {
     aRanges.AppendElement(MediaByteRange(0, mLength));
     return NS_OK;
   }
 
   bool IsTransportSeekable() MOZ_OVERRIDE { return true; }
 
--- a/content/media/DecoderTraits.cpp
+++ b/content/media/DecoderTraits.cpp
@@ -44,19 +44,16 @@
 #include "MediaOmxReader.h"
 #include "nsIPrincipal.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #endif
 #ifdef MOZ_RTSP
 #include "RtspOmxDecoder.h"
 #include "RtspOmxReader.h"
 #endif
-#ifdef MOZ_DASH
-#include "DASHDecoder.h"
-#endif
 #ifdef MOZ_WMF
 #include "WMFDecoder.h"
 #include "WMFReader.h"
 #endif
 #ifdef MOZ_DIRECTSHOW
 #include "DirectShowDecoder.h"
 #include "DirectShowReader.h"
 #endif
@@ -280,34 +277,16 @@ IsMediaPluginsType(const nsACString& aTy
 
   static const char* supportedTypes[] = {
     "audio/mpeg", "audio/mp4", "video/mp4", nullptr
   };
   return CodecListContains(supportedTypes, aType);
 }
 #endif
 
-#ifdef MOZ_DASH
-/* static */
-static const char* const gDASHMPDTypes[2] = {
-  "application/dash+xml",
-  nullptr
-};
-
-static bool
-IsDASHMPDType(const nsACString& aType)
-{
-  if (!MediaDecoder::IsDASHEnabled()) {
-    return false;
-  }
-
-  return CodecListContains(gDASHMPDTypes, aType);
-}
-#endif
-
 #ifdef MOZ_WMF
 static bool
 IsWMFSupportedType(const nsACString& aType)
 {
   return WMFDecoder::GetSupportedCodecs(aType, nullptr);
 }
 #endif
 
@@ -394,23 +373,16 @@ DecoderTraits::CanHandleMediaType(const 
   }
 #endif
 #ifdef MOZ_WEBM
   if (IsWebMType(nsDependentCString(aMIMEType))) {
     codecList = gWebMCodecs;
     result = CANPLAY_YES;
   }
 #endif
-#ifdef MOZ_DASH
-  if (IsDASHMPDType(nsDependentCString(aMIMEType))) {
-    // DASH manifest uses WebM codecs only.
-    codecList = gWebMCodecs;
-    result = CANPLAY_YES;
-  }
-#endif
 #ifdef MOZ_GSTREAMER
   if (GStreamerDecoder::CanHandleMediaType(nsDependentCString(aMIMEType),
                                            aHaveRequestedCodecs ? &aRequestedCodecs : nullptr)) {
     if (aHaveRequestedCodecs)
       return CANPLAY_YES;
     return CANPLAY_MAYBE;
   }
 #endif
@@ -525,21 +497,16 @@ DecoderTraits::CreateDecoder(const nsACS
     decoder = new MediaPluginDecoder(aType);
   }
 #endif
 #ifdef MOZ_WEBM
   if (IsWebMType(aType)) {
     decoder = new WebMDecoder();
   }
 #endif
-#ifdef MOZ_DASH
-  if (IsDASHMPDType(aType)) {
-    decoder = new DASHDecoder();
-  }
-#endif
 #ifdef MOZ_DIRECTSHOW
   // Note: DirectShow decoder must come before WMFDecoder, else the pref
   // "media.directshow.preferred" won't be honored.
   if (IsDirectShowSupportedType(aType)) {
     decoder = new DirectShowDecoder();
   }
 #endif
 #ifdef MOZ_WMF
@@ -612,19 +579,16 @@ MediaDecoderReader* DecoderTraits::Creat
     decoderReader = new WMFReader(aDecoder);
   } else
 #endif
 #ifdef MOZ_APPLEMEDIA
   if (IsAppleMediaSupportedType(aType)) {
     decoderReader = new AppleMP3Reader(aDecoder);
   } else
 #endif
-#ifdef MOZ_DASH
-  // The DASH decoder is not supported.
-#endif
   if (false) {} // dummy if to take care of the dangling else
 
   return decoderReader;
 }
 
 /* static */
 bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
 {
@@ -635,19 +599,16 @@ bool DecoderTraits::IsSupportedInVideoDo
 #ifdef MOZ_OMX_DECODER
     // We support amr inside WebApps on firefoxOS but not in general web content.
     // Ensure we dont create a VideoDocument when accessing amr URLs directly.
     (IsOmxSupportedType(aType) && !aType.EqualsASCII("audio/amr")) ||
 #endif
 #ifdef MOZ_WEBM
     IsWebMType(aType) ||
 #endif
-#ifdef MOZ_DASH
-    IsDASHMPDType(aType) ||
-#endif
 #ifdef MOZ_GSTREAMER
     IsGStreamerSupportedType(aType) ||
 #endif
 #ifdef MOZ_MEDIA_PLUGINS
     (MediaDecoder::IsMediaPluginsEnabled() && IsMediaPluginsType(aType)) ||
 #endif
 #ifdef MOZ_WMF
     (IsWMFSupportedType(aType) &&
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -1734,24 +1734,16 @@ MediaDecoder::IsOmxEnabled()
 #ifdef MOZ_MEDIA_PLUGINS
 bool
 MediaDecoder::IsMediaPluginsEnabled()
 {
   return Preferences::GetBool("media.plugins.enabled");
 }
 #endif
 
-#ifdef MOZ_DASH
-bool
-MediaDecoder::IsDASHEnabled()
-{
-  return Preferences::GetBool("media.dash.enabled");
-}
-#endif
-
 #ifdef MOZ_WMF
 bool
 MediaDecoder::IsWMFEnabled()
 {
   return WMFDecoder::IsEnabled();
 }
 #endif
 
--- a/content/media/MediaDecoder.h
+++ b/content/media/MediaDecoder.h
@@ -782,20 +782,16 @@ public:
 #ifdef MOZ_OMX_DECODER
   static bool IsOmxEnabled();
 #endif
 
 #ifdef MOZ_MEDIA_PLUGINS
   static bool IsMediaPluginsEnabled();
 #endif
 
-#ifdef MOZ_DASH
-  static bool IsDASHEnabled();
-#endif
-
 #ifdef MOZ_WMF
   static bool IsWMFEnabled();
 #endif
 
 #ifdef MOZ_APPLEMEDIA
   static bool IsAppleMP3Enabled();
 #endif
 
--- a/content/media/MediaDecoderReader.h
+++ b/content/media/MediaDecoderReader.h
@@ -483,21 +483,16 @@ public:
   virtual nsresult ResetDecode();
 
   // Decodes an unspecified amount of audio data, enqueuing the audio data
   // in mAudioQueue. Returns true when there's more audio to decode,
   // false if the audio is finished, end of file has been reached,
   // or an un-recoverable read error has occured.
   virtual bool DecodeAudioData() = 0;
 
-#ifdef MOZ_DASH
-  // Steps to carry out at the start of the |DecodeLoop|.
-  virtual void PrepareToDecode() { }
-#endif
-
   // Reads and decodes one video frame. Packets with a timestamp less
   // than aTimeThreshold will be decoded (unless they're not keyframes
   // and aKeyframeSkip is true), but will not be added to the queue.
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
                                 int64_t aTimeThreshold) = 0;
 
   virtual bool HasAudio() = 0;
   virtual bool HasVideo() = 0;
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -848,20 +848,16 @@ void MediaDecoderStateMachine::DecodeLoo
 
   // Main decode loop.
   bool videoPlaying = HasVideo();
   bool audioPlaying = HasAudio();
   while ((mState == DECODER_STATE_DECODING || mState == DECODER_STATE_BUFFERING) &&
          !mStopDecodeThread &&
          (videoPlaying || audioPlaying))
   {
-#ifdef MOZ_DASH
-    mReader->PrepareToDecode();
-#endif
-
     // We don't want to consider skipping to the next keyframe if we've
     // only just started up the decode loop, so wait until we've decoded
     // some frames before enabling the keyframe skip logic on video.
     if (videoPump &&
         (static_cast<uint32_t>(mReader->VideoQueue().GetSize())
          >= videoPumpThreshold * mPlaybackRate))
     {
       videoPump = false;
--- a/content/media/MediaResource.cpp
+++ b/content/media/MediaResource.cpp
@@ -54,22 +54,16 @@ ChannelMediaResource::ChannelMediaResour
                                            const nsACString& aContentType)
   : BaseMediaResource(aDecoder, aChannel, aURI, aContentType),
     mOffset(0), mSuspendCount(0),
     mReopenOnError(false), mIgnoreClose(false),
     mCacheStream(MOZ_THIS_IN_INITIALIZER_LIST()),
     mLock("ChannelMediaResource.mLock"),
     mIgnoreResume(false),
     mSeekingForMetadata(false),
-#ifdef MOZ_DASH
-    mByteRangeDownloads(false),
-    mByteRangeFirstOpen(true),
-    mSeekOffsetMonitor("media.dashseekmonitor"),
-    mSeekOffset(-1),
-#endif
     mIsTransportSeekable(true)
 {
 #ifdef PR_LOGGING
   if (!gMediaResourceLog) {
     gMediaResourceLog = PR_NewLogModule("MediaResource");
   }
 #endif
 }
@@ -412,26 +406,16 @@ ChannelMediaResource::OnStopRequest(nsIR
   NS_ASSERTION(mSuspendCount == 0,
                "How can OnStopRequest fire while we're suspended?");
 
   {
     MutexAutoLock lock(mLock);
     mChannelStatistics->Stop();
   }
 
-#ifdef MOZ_DASH
-  // If we were loading a byte range, notify decoder and return.
-  // Skip this for unterminated byte range requests, e.g. seeking for whole
-  // file downloads.
-  if (mByteRangeDownloads) {
-    mDecoder->NotifyDownloadEnded(aStatus);
-    return NS_OK;
-  }
-#endif
-
   // Note that aStatus might have succeeded --- this might be a normal close
   // --- even in situations where the server cut us off because we were
   // suspended. So we need to "reopen on error" in that case too. The only
   // cases where we don't need to reopen are when *we* closed the stream.
   // But don't reopen if we need to seek and we don't think we can... that would
   // cause us to just re-read the stream, which would be really bad.
   if (mReopenOnError &&
       aStatus != NS_ERROR_PARSED_DATA_CACHED && aStatus != NS_BINDING_ABORTED &&
@@ -485,28 +469,16 @@ ChannelMediaResource::CopySegmentToCache
                                          uint32_t aToOffset,
                                          uint32_t aCount,
                                          uint32_t *aWriteCount)
 {
   CopySegmentClosure* closure = static_cast<CopySegmentClosure*>(aClosure);
 
   closure->mResource->mDecoder->NotifyDataArrived(aFromSegment, aCount, closure->mResource->mOffset);
 
-#ifdef MOZ_DASH
-  // For byte range downloads controlled by |DASHDecoder|, there are cases in
-  // which the reader's offset is different enough from the channel offset that
-  // |MediaCache| requests a |CacheClientSeek| to the reader's offset. This
-  // can happen between calls to |CopySegmentToCache|. To avoid copying at
-  // incorrect offsets, ensure |MediaCache| copies to the location that
-  // |ChannelMediaResource| expects.
-  if (closure->mResource->mByteRangeDownloads) {
-    closure->mResource->mCacheStream.NotifyDataStarted(closure->mResource->mOffset);
-  }
-#endif
-
   // Keep track of where we're up to.
   LOG("%p [ChannelMediaResource]: CopySegmentToCache at mOffset [%lld] add "
       "[%d] bytes for decoder[%p]",
       closure->mResource, closure->mResource->mOffset, aCount,
       closure->mResource->mDecoder);
   closure->mResource->mOffset += aCount;
 
   closure->mResource->mCacheStream.NotifyDataReceived(aCount, aFromSegment,
@@ -543,49 +515,16 @@ ChannelMediaResource::OnDataAvailable(ns
       return rv;
     NS_ASSERTION(read > 0, "Read 0 bytes while data was available?");
     count -= read;
   }
 
   return NS_OK;
 }
 
-#ifdef MOZ_DASH
-/* |OpenByteRange|
- * For terminated byte range requests, use this function.
- * Callback is |MediaDecoder|::|NotifyByteRangeDownloaded|().
- * See |CacheClientSeek| also.
- */
-
-nsresult
-ChannelMediaResource::OpenByteRange(nsIStreamListener** aStreamListener,
-                                    MediaByteRange const & aByteRange)
-{
-  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
-
-  mByteRangeDownloads = true;
-  mByteRange = aByteRange;
-
-  // OpenByteRange may be called multiple times; same URL, different ranges.
-  // For the first call using this URL, forward to Open for some init.
-  if (mByteRangeFirstOpen) {
-    mByteRangeFirstOpen = false;
-    return Open(aStreamListener);
-  }
-
-  // For subsequent calls, ensure channel is recreated with correct byte range.
-  CloseChannel();
-
-  nsresult rv = RecreateChannel();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return OpenChannel(aStreamListener);
-}
-#endif
-
 nsresult ChannelMediaResource::Open(nsIStreamListener **aStreamListener)
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
 
   if (!mChannelStatistics) {
     mChannelStatistics = new MediaChannelStatistics();
   }
 
@@ -827,23 +766,16 @@ nsresult ChannelMediaResource::ReadAt(in
 }
 
 nsresult ChannelMediaResource::Seek(int32_t aWhence, int64_t aOffset)
 {
   NS_ASSERTION(!NS_IsMainThread(), "Don't call on main thread");
 
   CMLOG("Seek requested for aOffset [%lld] for decoder [%p]",
         aOffset, mDecoder);
-#ifdef MOZ_DASH
-  // Remember |aOffset|, because Media Cache may request a diff offset later.
-  if (mByteRangeDownloads) {
-    ReentrantMonitorAutoEnter mon(mSeekOffsetMonitor);
-    mSeekOffset = aOffset;
-  }
-#endif
   return mCacheStream.Seek(aWhence, aOffset);
 }
 
 void ChannelMediaResource::StartSeekingForMetadata()
 {
   mSeekingForMetadata = true;
 }
 
@@ -1040,118 +972,24 @@ ChannelMediaResource::CacheClientNotifyP
 nsresult
 ChannelMediaResource::CacheClientSeek(int64_t aOffset, bool aResume)
 {
   NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
 
   CMLOG("CacheClientSeek requested for aOffset [%lld] for decoder [%p]",
         aOffset, mDecoder);
 
-#ifndef MOZ_DASH
   CloseChannel();
-#else
-  // |CloseChannel| immediately for non-byte-range downloads.
-  if (!mByteRangeDownloads) {
-    CloseChannel();
-  } else if (mChannel) {
-    // Only close byte range channels if they are not in pending state.
-    bool isPending = false;
-    nsresult rv = mChannel->IsPending(&isPending);
-    NS_ENSURE_SUCCESS(rv, rv);
-    if (!isPending) {
-      CloseChannel();
-    }
-  }
-#endif
 
   if (aResume) {
     NS_ASSERTION(mSuspendCount > 0, "Too many resumes!");
     // No need to mess with the channel, since we're making a new one
     --mSuspendCount;
   }
 
-#ifdef MOZ_DASH  // Note: For chunked downloads, e.g. DASH, we need to determine which chunk
-  // contains the requested offset, |mOffset|. This is either previously
-  // requested in |Seek| or updated to the most recent bytes downloaded.
-  // So the process below is:
-  //   1 - Query decoder for chunk containing desired offset, |mOffset|.
-  //       Return silently if the offset is not available; suggests decoder is
-  //         yet to get range information.
-  //       Return with NetworkError for all other errors.
-  //
-  //   2 - Adjust |mByteRange|.mStart to |aOffset|, requested by media cache.
-  //       For seeking, the media cache always requests the start of the cache
-  //       block, so we need to adjust the first chunk of a seek.
-  //       E.g. For "DASH-WebM On Demand" this means the first chunk after
-  //       seeking will most likely be larger than the subsegment (cluster).
-  //
-  //   3 - Call |OpenByteRange| requesting |mByteRange| bytes.
-
-  if (mByteRangeDownloads) {
-    // Query decoder for chunk containing desired offset.
-    nsresult rv;
-    {
-      ReentrantMonitorAutoEnter mon(mSeekOffsetMonitor);
-      // Only continue with seek request if a prior call to |Seek| was made.
-      // If |Seek| was not called previously, it means the media cache is
-      // seeking on its own.
-      // E.g. For those WebM files which are encoded with cues at the end of
-      // the file, when the cues are parsed, the reader and media cache
-      // automatically return to the first offset not downloaded, normally the
-      // first byte after init data. This results in |MediaCache| requesting
-      // |aOffset| = 0 (aligning to the start of the cache block. Ignore this
-      // and let |DASHDecoder| decide which bytes to download and when.
-      if (mSeekOffset >= 0) {
-        rv = mDecoder->GetByteRangeForSeek(mSeekOffset, mByteRange);
-        // Cache may try to seek from the next uncached byte: this offset may
-        // be after the byte range being seeked, i.e. the range containing
-        // |mSeekOffset|, which is the offset actually requested by the reader.
-        // This case means that the seeked range is already cached. For byte
-        // range downloads, we do not permit the cache to request bytes outside
-        // the seeked range. Instead, the decoder is responsible for
-        // controlling the sequence of byte range downloads. As such, return
-        // silently, and do NOT request a new download.
-        if (NS_SUCCEEDED(rv) && !mByteRange.IsNull() &&
-            aOffset > mByteRange.mEnd) {
-          rv = NS_ERROR_NOT_AVAILABLE;
-          mByteRange.Clear();
-        }
-        mSeekOffset = -1;
-      } else if (mByteRange.mStart <= aOffset && aOffset <= mByteRange.mEnd) {
-        CMLOG("Trying to resume download at offset [%lld].", aOffset);
-        rv = NS_OK;
-      } else {
-        CMLOG("MediaCache [%p] trying to seek independently to offset [%lld].",
-            &mCacheStream, aOffset);
-        rv = NS_ERROR_NOT_AVAILABLE;
-      }
-    }
-    if (rv == NS_ERROR_NOT_AVAILABLE) {
-      // Decoder will not make byte ranges available for non-active streams, or
-      // if range information is not yet available, or for metadata bytes if
-      // they have already been downloaded and read. In all cases, it is ok to
-      // return silently and assume that the decoder will request the correct
-      // byte range when range information becomes available.
-      CMLOG("Byte range not available for decoder [%p]; returning "
-            "silently.", mDecoder);
-      return NS_OK;
-    } else if (NS_FAILED(rv) || mByteRange.IsNull()) {
-      // Decoder reported an error we don't want to handle here; just return.
-      CMLOG("Error getting byte range: seek offset[%lld] cache offset[%lld] "
-            "decoder[%p]", mSeekOffset, aOffset, mDecoder);
-      mDecoder->NetworkError();
-      CloseChannel();
-      return rv;
-    }
-    // Adjust the byte range to start where the media cache requested.
-    mByteRange.mStart = mOffset = aOffset;
-    return OpenByteRange(nullptr, mByteRange);
-  }
-#endif
-
   mOffset = aOffset;
 
   if (mSuspendCount > 0) {
     // Close the existing channel to force the channel to be recreated at
     // the correct offset upon resume.
     if (mChannel) {
       mIgnoreClose = true;
       CloseChannel();
--- a/content/media/MediaResource.h
+++ b/content/media/MediaResource.h
@@ -2,19 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #if !defined(MediaResource_h_)
 #define MediaResource_h_
 
 #include "mozilla/Mutex.h"
-#ifdef MOZ_DASH
-#include "mozilla/ReentrantMonitor.h"
-#endif
 #include "nsIChannel.h"
 #include "nsIURI.h"
 #include "nsIStreamingProtocolController.h"
 #include "nsIStreamListener.h"
 #include "nsIChannelEventSink.h"
 #include "nsIInterfaceRequestor.h"
 #include "MediaCache.h"
 #include "mozilla/Attributes.h"
@@ -357,29 +354,16 @@ public:
   static already_AddRefed<MediaResource> Create(MediaDecoder* aDecoder, nsIChannel* aChannel);
 
   /**
    * Open the stream. This creates a stream listener and returns it in
    * aStreamListener; this listener needs to be notified of incoming data.
    */
   virtual nsresult Open(nsIStreamListener** aStreamListener) = 0;
 
-#ifdef MOZ_DASH
-  /**
-   * Open the stream using a specific byte range only. Creates a stream
-   * listener and returns it in aStreamListener; this listener needs to be
-   * notified of incoming data. Byte range is specified in aByteRange.
-   */
-  virtual nsresult OpenByteRange(nsIStreamListener** aStreamListener,
-                                 MediaByteRange const &aByteRange)
-  {
-    return Open(aStreamListener);
-  }
-#endif
-
   /**
    * Fills aRanges with MediaByteRanges representing the data which is cached
    * in the media cache. Stream should be pinned during call and while
    * aRanges is being used.
    */
   virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) = 0;
 
   // Ensure that the media cache writes any data held in its partial block.
@@ -517,20 +501,16 @@ public:
   // Called on the main thread.
   virtual void FlushCache() MOZ_OVERRIDE;
 
   // Notify that the last data byte range was loaded.
   virtual void NotifyLastByteRange() MOZ_OVERRIDE;
 
   // Main thread
   virtual nsresult Open(nsIStreamListener** aStreamListener);
-#ifdef MOZ_DASH
-  virtual nsresult OpenByteRange(nsIStreamListener** aStreamListener,
-                                 MediaByteRange const & aByteRange);
-#endif
   virtual nsresult Close();
   virtual void     Suspend(bool aCloseImmediately);
   virtual void     Resume();
   virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal();
   // Return true if the stream has been closed.
   bool IsClosed() const { return mCacheStream.IsClosed(); }
   virtual bool     CanClone();
   virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder);
@@ -662,30 +642,16 @@ protected:
   bool mIgnoreResume;
 
   // True if we are seeking to get the real duration of the file.
   bool mSeekingForMetadata;
 
   // Start and end offset of the bytes to be requested.
   MediaByteRange mByteRange;
 
-#ifdef MOZ_DASH
-  // True if resource was opened with a byte rage request.
-  bool mByteRangeDownloads;
-
-  // Set to false once first byte range request has been made.
-  bool mByteRangeFirstOpen;
-
-  // For byte range requests, set to the offset requested in |Seek|.
-  // Used in |CacheClientSeek| to find the originally requested byte range.
-  // Read/Write on multiple threads; use |mSeekMonitor|.
-  ReentrantMonitor mSeekOffsetMonitor;
-  int64_t mSeekOffset;
-#endif
-
   // True if the stream can seek into unbuffered ranged, i.e. if the
   // connection supports byte range requests.
   bool mIsTransportSeekable;
 };
 
 } // namespace mozilla
 
 #endif
--- a/content/media/test/Makefile.in
+++ b/content/media/test/Makefile.in
@@ -376,36 +376,16 @@ MOCHITEST_FILES += \
 		test_can_play_type_webm.html \
 		$(NULL)
 else
 MOCHITEST_FILES += \
 		test_can_play_type_no_webm.html \
 		$(NULL)
 endif
 
-ifdef MOZ_DASH
-MOCHITEST_FILES += \
-    test_can_play_type_dash.html \
-    dash/dash-manifest.mpd \
-    dash/dash-manifest-sjs.mpd \
-    test_dash_detect_stream_switch.html \
-    dash_detect_stream_switch.sjs \
-    dash/dash-webm-video-320x180.webm \
-    dash/dash-webm-video-428x240.webm \
-    dash/dash-webm-audio-128k.webm \
-    dash/dash-manifest-garbled.mpd \
-    dash/dash-manifest-garbled-webm.mpd \
-    dash/garbled.webm \
-    $(NULL)
-else
-MOCHITEST_FILES += \
-    test_can_play_type_no_dash.html \
-    $(NULL)
-endif
-
 ifdef MOZ_WAVE
 MOCHITEST_FILES += \
 		test_can_play_type_wave.html \
 		$(NULL)
 
 
 # Bug 759221
 MOCHITEST_FILES += \
deleted file mode 100644
--- a/content/media/test/test_can_play_type_dash.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=792935
--->
-<head>
-  <title>Test for Bug 792935: DASH: Add DASH-WebM cases to mochitests</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="text/javascript" src="manifest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792935">Mozilla Bug 792935: DASH: Add DASH-WebM cases to mochitests</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-
-<video id="v"></video>
-
-<pre id="test">
-<script src="can_play_type_dash.js"></script>
-<script>
-var enabledByPref = SpecialPowers.getBoolPref("media.dash.enabled");
-check_dash(document.getElementById('v'), enabledByPref);
-mediaTestCleanup();
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/content/media/test/test_can_play_type_no_dash.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=792935
--->
-<head>
-  <title>Test for Bug 792935: DASH: Add DASH-WebM cases to mochitests</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="text/javascript" src="manifest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792935">Mozilla Bug 792935: DASH: Add DASH-WebM cases to mochitests</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-
-<video id="v"></video>
-
-<pre id="test">
-<script src="can_play_type_dash.js"></script>
-<script>
-check_dash(document.getElementById('v'), false);
-mediaTestCleanup();
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/content/media/test/test_dash_detect_stream_switch.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=792935
--->
-<head>
-  <title>Test for Bug 792935 - DASH Stream Switching</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="manifest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792935">Mozilla Bug 792935</a>
-  
-</div>
-<pre id="test">
-<script type="text/javascript">
-
-var manager = new MediaTestManager;
-
-function createTestArray() {
-  var tests = [];
-  var tmpVid = document.createElement("video");
-
-  for (var testNum=0; testNum<gStreamSwitchTests.length; testNum++) {
-    var test = gStreamSwitchTests[testNum];
-    if (!tmpVid.canPlayType(test.type)) {
-      continue;
-    }
-    tests.push(test);
-  }
-  return tests;
-}
-
-function ended(evt) {
-  var v = evt.target;
-  if (v.parentNode) {
-    v.parentNode.removeChild(v);
-  }
-  ok(true, "Fully played DASH video implies correct byte ranges downloaded.");
-  dump("STREAM-SWITCH-TEST: Finished " + v._name + "\n");
-  manager.finished(v.token);
-}
-
-function error(evt) {
-  var v = evt.target;
-  ok(false, "Error suggests wrong byte range requested for " + v._name);
-}
-
-function startTest(test, token) {
-  var v = document.createElement('video');
-  manager.started(token);
-  v.type = test.type;
-  v.src = test.name;
-  v._name = test.name + " stream switch test";
-  v.token = token;
-  v.autoplay = true;
-
-  v.addEventListener("error", error, false);
-  v.addEventListener("ended", ended, false);
-
-  dump("STREAM-SWITCH-TEST: Started " + name + "\n");
-  document.body.appendChild(v);
-}
-
-var testArray = createTestArray();
-if (testArray && testArray.length > 0) {
-  manager.runTests(testArray, startTest);
-} else {
-  var v = document.createElement('video');
-  var canPlay = v.canPlayType("application/dash+xml");
-  // If the test array is empty even though DASH is enabled, the test should
-  // fail, i.e. canPlay should be false when testArray is empty.
-  todo(canPlay, "No types supported - DASH " +
-                (canPlay ? "enabled" : "disabled"));
-}  
-
-</script>
-</pre>
-</body>
-</html>
--- a/content/media/webm/Makefile.in
+++ b/content/media/webm/Makefile.in
@@ -3,13 +3,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES = \
 		$(MOZ_LIBVPX_CFLAGS) \
 		$(NULL)
 
-ifdef MOZ_DASH
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../dash \
-  $(NULL)
-endif
--- a/content/media/webm/WebMReader.cpp
+++ b/content/media/webm/WebMReader.cpp
@@ -43,19 +43,16 @@ PRLogModuleInfo* gNesteggLog;
 #endif
 #else
 #define LOG(type, msg)
 #define SEEK_LOG(type, msg)
 #endif
 
 static const unsigned NS_PER_USEC = 1000;
 static const double NS_PER_S = 1e9;
-#ifdef MOZ_DASH
-static const double USEC_PER_S = 1e6;
-#endif
 
 // Functions for reading and seeking using MediaResource required for
 // nestegg_io. The 'user data' passed to these functions is the
 // decoder from which the media resource is obtained.
 static int webm_read(void *aBuffer, size_t aLength, void *aUserData)
 {
   NS_ASSERTION(aUserData, "aUserData must point to a valid AbstractMediaDecoder");
   AbstractMediaDecoder* decoder = reinterpret_cast<AbstractMediaDecoder*>(aUserData);
@@ -135,40 +132,26 @@ static void webm_log(nestegg * context,
   PR_vsnprintf(msg+strlen(msg), sizeof(msg)-strlen(msg), format, args);
   PR_LOG(gNesteggLog, PR_LOG_DEBUG, (msg));
 
   va_end(args);
 #endif
 }
 
 WebMReader::WebMReader(AbstractMediaDecoder* aDecoder)
-#ifdef MOZ_DASH
-  : DASHRepReader(aDecoder),
-#else
   : MediaDecoderReader(aDecoder),
-#endif
   mContext(nullptr),
   mPacketCount(0),
   mChannels(0),
   mVideoTrack(0),
   mAudioTrack(0),
   mAudioStartUsec(-1),
   mAudioFrames(0),
   mHasVideo(false),
   mHasAudio(false)
-#ifdef MOZ_DASH
-  , mMainReader(nullptr),
-  mSwitchingCluster(-1),
-  mNextReader(nullptr),
-  mSeekToCluster(-1),
-  mCurrentOffset(-1),
-  mNextCluster(1),
-  mPushVideoPacketToNextReader(false),
-  mReachedSwitchAccessPoint(false)
-#endif
 {
   MOZ_COUNT_CTOR(WebMReader);
 #ifdef PR_LOGGING
   if (!gNesteggLog) {
     gNesteggLog = PR_NewLogModule("Nestegg");
   }
 #endif
   // Zero these member vars to avoid crashes in VP8 destroy and Vorbis clear
@@ -229,59 +212,38 @@ nsresult WebMReader::ResetDecode()
   // Ignore failed results from vorbis_synthesis_restart. They
   // aren't fatal and it fails when ResetDecode is called at a
   // time when no vorbis data has been read.
   vorbis_synthesis_restart(&mVorbisDsp);
 
   mVideoPackets.Reset();
   mAudioPackets.Reset();
 
-#ifdef MOZ_DASH
-  LOG(PR_LOG_DEBUG, ("Resetting DASH seek vars"));
-  mSwitchingCluster = -1;
-  mNextReader = nullptr;
-  mSeekToCluster = -1;
-  mCurrentOffset = -1;
-  mPushVideoPacketToNextReader = false;
-  mReachedSwitchAccessPoint = false;
-#endif
-
   return res;
 }
 
 void WebMReader::Cleanup()
 {
   if (mContext) {
     nestegg_destroy(mContext);
     mContext = nullptr;
   }
 }
 
 nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
                                   MetadataTags** aTags)
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
 
-#ifdef MOZ_DASH
-  LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: Reading WebM Metadata: "
-                     "init bytes [%d - %d] cues bytes [%d - %d]",
-                     this, mDecoder,
-                     mInitByteRange.mStart, mInitByteRange.mEnd,
-                     mCuesByteRange.mStart, mCuesByteRange.mEnd));
-#endif
   nestegg_io io;
   io.read = webm_read;
   io.seek = webm_seek;
   io.tell = webm_tell;
   io.userdata = mDecoder;
-#ifdef MOZ_DASH
-  int64_t maxOffset = mInitByteRange.IsNull() ? -1 : mInitByteRange.mEnd;
-#else
   int64_t maxOffset = -1;
-#endif
   int r = nestegg_init(&mContext, io, &webm_log, maxOffset);
   if (r == -1) {
     return NS_ERROR_FAILURE;
   }
 
   uint64_t duration = 0;
   r = nestegg_duration(mContext, &duration);
   if (r == 0) {
@@ -419,66 +381,23 @@ nsresult WebMReader::ReadMetadata(MediaI
       }
 
       mInfo.mAudio.mRate = mVorbisDsp.vi->rate;
       mInfo.mAudio.mChannels = mVorbisDsp.vi->channels;
       mChannels = mInfo.mAudio.mChannels;
     }
   }
 
-#ifdef MOZ_DASH
-  // Byte range for cues has been specified; load them.
-  if (!mCuesByteRange.IsNull()) {
-    maxOffset = mCuesByteRange.mEnd;
-
-    // Iterate through cluster ranges until nestegg returns the last one
-    NS_ENSURE_TRUE(mClusterByteRanges.IsEmpty(),
-                   NS_ERROR_ALREADY_INITIALIZED);
-    int clusterNum = 0;
-    bool done = false;
-    uint64_t timestamp;
-    do {
-      mClusterByteRanges.AppendElement();
-      r = nestegg_get_cue_point(mContext, clusterNum, maxOffset,
-                                &(mClusterByteRanges[clusterNum].mStart),
-                                &(mClusterByteRanges[clusterNum].mEnd),
-                                &timestamp);
-      if (r != 0) {
-        Cleanup();
-        return NS_ERROR_FAILURE;
-      }
-      LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: Cluster [%d]: "
-                         "start [%lld] end [%lld], timestamp [%.2llfs]",
-                         this, mDecoder, clusterNum,
-                         mClusterByteRanges[clusterNum].mStart,
-                         mClusterByteRanges[clusterNum].mEnd,
-                         timestamp/NS_PER_S));
-      mClusterByteRanges[clusterNum].mStartTime = timestamp/NS_PER_USEC;
-      // Last cluster will have '-1' as end value
-      if (mClusterByteRanges[clusterNum].mEnd == -1) {
-        mClusterByteRanges[clusterNum].mEnd = (mCuesByteRange.mStart-1);
-        done = true;
-      } else {
-        clusterNum++;
-      }
-    } while (!done);
-  }
-#endif
-
   // We can't seek in buffered regions if we have no cues.
   mDecoder->SetMediaSeekable(nestegg_has_cues(mContext) == 1);
 
   *aInfo = mInfo;
 
   *aTags = nullptr;
 
-#ifdef MOZ_DASH
-  mDecoder->OnReadMetadataCompleted();
-#endif
-
   return NS_OK;
 }
 
 ogg_packet WebMReader::InitOggPacket(unsigned char* aData,
                                        size_t aLength,
                                        bool aBOS,
                                        bool aEOS,
                                        int64_t aGranulepos)
@@ -606,103 +525,16 @@ bool WebMReader::DecodeAudioPacket(neste
       }
     }
   }
 
   return true;
 }
 
 nsReturnRef<NesteggPacketHolder> WebMReader::NextPacket(TrackType aTrackType)
-#ifdef MOZ_DASH
-{
-  nsAutoRef<NesteggPacketHolder> holder;
-  // It is possible that following a seek, a requested switching offset could
-  // be reached before |DASHReader| calls |RequestSwitchAtSubsegment|. In this
-  // case |mNextReader| will be null, so check its value and at every possible
-  // switch access point, i.e. cluster boundary, ask |mMainReader| to
-  // |GetReaderForSubsegment|.
-  if (mMainReader && !mNextReader && aTrackType == VIDEO) {
-    WebMReader* nextReader = nullptr;
-    LOG(PR_LOG_DEBUG,
-      ("WebMReader[%p] for decoder [%p] NextPacket mNextReader not set: "
-       "mCurrentOffset[%lld] nextCluster [%d] comparing with offset[%lld]",
-       this, mDecoder, mCurrentOffset, mNextCluster,
-       mClusterByteRanges[mNextCluster].mStart));
-
-    if (mNextCluster < mClusterByteRanges.Length() &&
-        mCurrentOffset == mClusterByteRanges[mNextCluster].mStart) {
-      DASHRepReader* nextDASHRepReader =
-        mMainReader->GetReaderForSubsegment(mNextCluster);
-      nextReader = static_cast<WebMReader*>(nextDASHRepReader);
-      LOG(PR_LOG_DEBUG,
-          ("WebMReader[%p] for decoder [%p] reached SAP at cluster [%d]: next "
-         "reader is [%p]", this, mDecoder, mNextCluster, nextReader));
-      if (nextReader && nextReader != this) {
-        {
-          ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
-          // Ensure this reader is set to switch for the next packet.
-          RequestSwitchAtSubsegment(mNextCluster, nextReader);
-          NS_ASSERTION(mNextReader == nextReader, "mNextReader should be set");
-          // Ensure the next reader seeks to |mNextCluster|. |PrepareToDecode|
-          // must be called to ensure the reader's variables are set correctly.
-          nextReader->RequestSeekToSubsegment(mNextCluster);
-          nextReader->PrepareToDecode();
-        }
-      }
-      // Keep mNextCluster up-to-date with the |mCurrentOffset|.
-      if (mNextCluster+1 < mClusterByteRanges.Length()) {
-        // At least one more cluster to go.
-        mNextCluster++;
-      } else {
-        // Reached last cluster; prepare for being in cluster 0 again.
-        mNextCluster = 1;
-      }
-      LOG(PR_LOG_DEBUG,
-          ("WebMReader [%p] for decoder [%p] updating mNextCluster to [%d] "
-           "at offset [%lld]", this, mDecoder, mNextCluster, mCurrentOffset));
-    }
-  }
-
-  // Get packet from next reader if we're at a switching point; most likely we
-  // did not download the next packet for this reader's stream, so we have to
-  // get it from the next one. Note: Switch to next reader only for video;
-  // audio switching is not supported in the DASH-WebM On Demand profile.
-  if (aTrackType == VIDEO &&
-      (uint32_t)mSwitchingCluster < mClusterByteRanges.Length() &&
-      mCurrentOffset == mClusterByteRanges[mSwitchingCluster].mStart) {
-
-    if (mVideoPackets.GetSize() > 0) {
-      holder = NextPacketInternal(VIDEO);
-      LOG(PR_LOG_DEBUG,
-          ("WebMReader[%p] got packet from mVideoPackets @[%lld]",
-           this, holder->mOffset));
-    } else {
-      mReachedSwitchAccessPoint = true;
-      NS_ASSERTION(mNextReader,
-                   "Stream switch has been requested but mNextReader is null");
-      holder = mNextReader->NextPacket(aTrackType);
-      mPushVideoPacketToNextReader = true;
-      // Reset for possible future switches.
-      mSwitchingCluster = -1;
-      LOG(PR_LOG_DEBUG,
-          ("WebMReader[%p] got packet from mNextReader[%p] @[%lld]",
-           this, mNextReader.get(), (holder ? holder->mOffset : 0)));
-    }
-  } else {
-    holder = NextPacketInternal(aTrackType);
-    if (holder) {
-      mCurrentOffset = holder->mOffset;
-    }
-  }
-  return holder.out();
-}
-
-nsReturnRef<NesteggPacketHolder>
-WebMReader::NextPacketInternal(TrackType aTrackType)
-#endif
 {
   // The packet queue that packets will be pushed on if they
   // are not the type we are interested in.
   WebMPacketQueue& otherPackets =
     aTrackType == VIDEO ? mAudioPackets : mVideoPackets;
 
   // The packet queue for the type that we are interested in.
   WebMPacketQueue &packets =
@@ -923,28 +755,17 @@ bool WebMReader::DecodeVideoFrame(bool &
   }
 
   return true;
 }
 
 void
 WebMReader::PushVideoPacket(NesteggPacketHolder* aItem)
 {
-#ifdef MOZ_DASH
-  if (mPushVideoPacketToNextReader) {
-    NS_ASSERTION(mNextReader,
-                 "Stream switch has been requested but mNextReader is null");
-    mNextReader->mVideoPackets.PushFront(aItem);
-    mPushVideoPacketToNextReader = false;
-  } else {
-#endif
     mVideoPackets.PushFront(aItem);
-#ifdef MOZ_DASH
-  }
-#endif
 }
 
 nsresult WebMReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime,
                             int64_t aCurrentTime)
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
 
   LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: About to seek to %fs",
@@ -952,66 +773,19 @@ nsresult WebMReader::Seek(int64_t aTarge
   if (NS_FAILED(ResetDecode())) {
     return NS_ERROR_FAILURE;
   }
   uint32_t trackToSeek = mHasVideo ? mVideoTrack : mAudioTrack;
   int r = nestegg_track_seek(mContext, trackToSeek, aTarget * NS_PER_USEC);
   if (r != 0) {
     return NS_ERROR_FAILURE;
   }
-#ifdef MOZ_DASH
-  // Find next cluster index;
-  MediaResource* resource = mDecoder->GetResource();
-  int64_t newOffset = resource->Tell();
-  for (uint32_t i = 1; i < mClusterByteRanges.Length(); i++) {
-    if (newOffset < mClusterByteRanges[i].mStart) {
-      mNextCluster = i;
-      LOG(PR_LOG_DEBUG,
-          ("WebMReader [%p] for decoder [%p] updating mNextCluster to [%d] "
-           "after seek to offset [%lld]",
-           this, mDecoder, mNextCluster, resource->Tell()));
-      break;
-    }
-  }
-#endif
   return DecodeToTarget(aTarget);
 }
 
-#ifdef MOZ_DASH
-bool WebMReader::IsDataCachedAtEndOfSubsegments()
-{
-  MediaResource* resource = mDecoder->GetResource();
-  NS_ENSURE_TRUE(resource, false);
-  if (resource->IsDataCachedToEndOfResource(0)) {
-     return true;
-  }
-
-  if (mClusterByteRanges.IsEmpty()) {
-    return false;
-  }
-
-  nsTArray<MediaByteRange> ranges;
-  nsresult rv = resource->GetCachedRanges(ranges);
-  NS_ENSURE_SUCCESS(rv, false);
-  if (ranges.IsEmpty()) {
-    return false;
-  }
-
-  // Return true if data at the end of the final subsegment is cached.
-  uint32_t finalSubsegmentIndex = mClusterByteRanges.Length()-1;
-  uint64_t finalSubEndOffset = mClusterByteRanges[finalSubsegmentIndex].mEnd;
-  uint32_t finalRangeIndex = ranges.Length()-1;
-  uint64_t finalRangeStartOffset = ranges[finalRangeIndex].mStart;
-  uint64_t finalRangeEndOffset = ranges[finalRangeIndex].mEnd;
-
-  return (finalRangeStartOffset < finalSubEndOffset &&
-          finalSubEndOffset <= finalRangeEndOffset);
-}
-#endif
-
 nsresult WebMReader::GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime)
 {
   MediaResource* resource = mDecoder->GetResource();
 
   uint64_t timecodeScale;
   if (!mContext || nestegg_tstamp_scale(mContext, &timecodeScale) == -1) {
     return NS_OK;
   }
@@ -1039,39 +813,16 @@ nsresult WebMReader::GetBuffered(dom::Ti
     for (uint32_t index = 0; index < ranges.Length(); index++) {
       uint64_t start, end;
       bool rv = mBufferedState->CalculateBufferedForRange(ranges[index].mStart,
                                                           ranges[index].mEnd,
                                                           &start, &end);
       if (rv) {
         double startTime = start * timecodeScale / NS_PER_S - aStartTime;
         double endTime = end * timecodeScale / NS_PER_S - aStartTime;
-#ifdef MOZ_DASH
-        // If this range extends to the end of a cluster, the true end time is
-        // the cluster's end timestamp. Since WebM frames do not have an end
-        // timestamp, a fully cached cluster must be reported with the correct
-        // end time of its final frame. Otherwise, buffered ranges could be
-        // reported with missing frames at cluster boundaries, specifically
-        // boundaries where stream switching has occurred.
-        if (!mClusterByteRanges.IsEmpty()) {
-          for (uint32_t clusterIndex = 0;
-               clusterIndex < (mClusterByteRanges.Length()-1);
-               clusterIndex++) {
-            if (ranges[index].mEnd >= mClusterByteRanges[clusterIndex].mEnd) {
-              double clusterEndTime =
-                  mClusterByteRanges[clusterIndex+1].mStartTime / USEC_PER_S;
-              if (endTime < clusterEndTime) {
-                LOG(PR_LOG_DEBUG, ("End of cluster: endTime becoming %0.3fs",
-                                   clusterEndTime));
-                endTime = clusterEndTime;
-              }
-            }
-          }
-        }
-#endif
         // If this range extends to the end of the file, the true end time
         // is the file's duration.
         if (resource->IsDataCachedToEndOfResource(ranges[index].mStart)) {
           uint64_t duration = 0;
           if (nestegg_duration(mContext, &duration) == 0) {
             endTime = duration / NS_PER_S;
           }
         }
@@ -1084,141 +835,9 @@ nsresult WebMReader::GetBuffered(dom::Ti
   return NS_OK;
 }
 
 void WebMReader::NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset)
 {
   mBufferedState->NotifyDataArrived(aBuffer, aLength, aOffset);
 }
 
-#ifdef MOZ_DASH
-int64_t
-WebMReader::GetSubsegmentForSeekTime(int64_t aSeekToTime)
-{
-  NS_ENSURE_TRUE(0 <= aSeekToTime, -1);
-  // Check the first n-1 subsegments. End time is the start time of the next
-  // subsegment.
-  for (uint32_t i = 1; i < (mClusterByteRanges.Length()); i++) {
-    if (aSeekToTime < mClusterByteRanges[i].mStartTime) {
-      return i-1;
-    }
-  }
-  // Check the last subsegment. End time is the end time of the file.
-  NS_ASSERTION(mDecoder, "Decoder should not be null!");
-  if (aSeekToTime <= mDecoder->GetMediaDuration()) {
-    return mClusterByteRanges.Length()-1;
-  }
-
-  return (-1);
-}
-nsresult
-WebMReader::GetSubsegmentByteRanges(nsTArray<MediaByteRange>& aByteRanges)
-{
-  NS_ENSURE_TRUE(mContext, NS_ERROR_NULL_POINTER);
-  NS_ENSURE_TRUE(aByteRanges.IsEmpty(), NS_ERROR_ALREADY_INITIALIZED);
-  NS_ENSURE_FALSE(mClusterByteRanges.IsEmpty(), NS_ERROR_NOT_INITIALIZED);
-  NS_ENSURE_FALSE(mCuesByteRange.IsNull(), NS_ERROR_NOT_INITIALIZED);
-
-  for (uint32_t i = 0; i < mClusterByteRanges.Length(); i++) {
-    aByteRanges.AppendElement();
-    aByteRanges[i] = mClusterByteRanges[i];
-  }
-
-  return NS_OK;
-}
-
-void
-WebMReader::RequestSwitchAtSubsegment(int32_t aSubsegmentIdx,
-                                      MediaDecoderReader* aNextReader)
-{
-  NS_ASSERTION(NS_IsMainThread() || mDecoder->OnDecodeThread(),
-               "Should be on main thread or decode thread.");
-  mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
-
-  // Only allow one switch at a time; ignore if one is already requested.
-  if (mSwitchingCluster != -1) {
-    return;
-  }
-  NS_ENSURE_TRUE_VOID((uint32_t)aSubsegmentIdx < mClusterByteRanges.Length());
-  mSwitchingCluster = aSubsegmentIdx;
-  NS_ENSURE_TRUE_VOID(aNextReader);
-  NS_ENSURE_TRUE_VOID(aNextReader != this);
-  mNextReader = static_cast<WebMReader*>(aNextReader);
-}
-
-void
-WebMReader::RequestSeekToSubsegment(uint32_t aIdx)
-{
-  NS_ASSERTION(NS_IsMainThread() || mDecoder->OnDecodeThread(),
-               "Should be on main thread or decode thread.");
-  NS_ASSERTION(mDecoder, "decoder should not be null!");
-  mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
-
-  // Don't seek if we're about to switch to another reader.
-  if (mSwitchingCluster != -1) {
-    return;
-  }
-  // Only allow seeking if a request was not already made.
-  if (mSeekToCluster != -1) {
-    return;
-  }
-  NS_ENSURE_TRUE_VOID(aIdx < mClusterByteRanges.Length());
-  mSeekToCluster = aIdx;
-
-  // XXX Hack to get the resource to seek to the correct offset if the decode
-  // thread is in shutdown, e.g. if the video is not autoplay.
-  if (mDecoder->IsShutdown()) {
-    ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
-    mDecoder->GetResource()->Seek(PR_SEEK_SET,
-                                  mClusterByteRanges[mSeekToCluster].mStart);
-  }
-}
-
-void
-WebMReader::PrepareToDecode()
-{
-  NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
-  if (mSeekToCluster != -1) {
-    ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
-    SeekToCluster(mSeekToCluster);
-  }
-}
-
-void
-WebMReader::SeekToCluster(uint32_t aIdx)
-{
-  NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
-  NS_ENSURE_TRUE_VOID(aIdx < mClusterByteRanges.Length());
-  LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: seeking to "
-                     "subsegment [%lld] at offset [%lld]",
-                     this, mDecoder, aIdx, mClusterByteRanges[aIdx].mStart));
-  int r = nestegg_offset_seek(mContext, mClusterByteRanges[aIdx].mStart);
-  NS_ENSURE_TRUE_VOID(r == 0);
-  if (aIdx + 1 < mClusterByteRanges.Length()) {
-    mNextCluster = aIdx + 1;
-  } else {
-    mNextCluster = 1;
-  }
-  mSeekToCluster = -1;
-}
-
-bool
-WebMReader::HasReachedSubsegment(uint32_t aSubsegmentIndex)
-{
-  NS_ASSERTION(mDecoder, "Decoder is null.");
-  NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
-  NS_ENSURE_TRUE(aSubsegmentIndex < mClusterByteRanges.Length(), false);
-
-  NS_ASSERTION(mDecoder->GetResource(), "Decoder has no media resource.");
-  if (mReachedSwitchAccessPoint) {
-    LOG(PR_LOG_DEBUG,
-        ("Reader [%p] for Decoder [%p]: reached switching offset [%lld] = "
-         "mClusterByteRanges[%d].mStart[%lld]",
-         this, mDecoder, mCurrentOffset, aSubsegmentIndex,
-         mClusterByteRanges[aSubsegmentIndex].mStart));
-    mReachedSwitchAccessPoint = false;
-    return true;
-  }
-  return false;
-}
-#endif /* MOZ_DASH */
-
 } // namespace mozilla
--- a/content/media/webm/WebMReader.h
+++ b/content/media/webm/WebMReader.h
@@ -17,20 +17,16 @@
 #include "vpx/vpx_codec.h"
 
 #ifdef MOZ_TREMOR
 #include "tremor/ivorbiscodec.h"
 #else
 #include "vorbis/codec.h"
 #endif
 
-#ifdef MOZ_DASH
-#include "DASHRepReader.h"
-#endif
-
 namespace mozilla {
 
 class WebMBufferedState;
 
 // Holds a nestegg_packet, and its file offset. This is needed so we
 // know the offset in the file we've played up to, in order to calculate
 // whether it's likely we can play through to the end without needing
 // to stop to buffer, given the current download rate.
@@ -96,21 +92,17 @@ class WebMPacketQueue : private nsDeque 
   
   void Reset() {
     while (GetSize() > 0) {
       delete PopFront();
     }
   }
 };
 
-#ifdef MOZ_DASH
-class WebMReader : public DASHRepReader
-#else
 class WebMReader : public MediaDecoderReader
-#endif
 {
 public:
   WebMReader(AbstractMediaDecoder* aDecoder);
   ~WebMReader();
 
   virtual nsresult Init(MediaDecoderReader* aCloneDonor);
   virtual nsresult ResetDecode();
   virtual bool DecodeAudioData();
@@ -134,109 +126,27 @@ public:
   }
 
   virtual nsresult ReadMetadata(MediaInfo* aInfo,
                                 MetadataTags** aTags);
   virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
   virtual nsresult GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime);
   virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset);
 
-#ifdef MOZ_DASH
-  virtual void SetMainReader(DASHReader *aMainReader) MOZ_OVERRIDE {
-    NS_ASSERTION(aMainReader, "aMainReader is null.");
-    mMainReader = aMainReader;
-  }
-
-  // Called by |DASHReader| on the decode thread so that this reader will
-  // start reading at the appropriate subsegment/cluster. If this is not the
-  // current reader and a switch was previously requested, then it will seek to
-  // starting offset of the subsegment at which it is supposed to switch.
-  // Called on the decode thread, enters the decode monitor.
-  void PrepareToDecode() MOZ_OVERRIDE;
-
-  // Returns a reference to the audio/video queue of the main reader.
-  // Allows for a single audio/video queue to be shared among multiple
-  // |WebMReader|s.
-  MediaQueue<AudioData>& AudioQueue() MOZ_OVERRIDE {
-    if (mMainReader) {
-      return mMainReader->AudioQueue();
-    } else {
-      return MediaDecoderReader::AudioQueue();
-    }
-  }
-
-  MediaQueue<VideoData>& VideoQueue() MOZ_OVERRIDE {
-    if (mMainReader) {
-      return mMainReader->VideoQueue();
-    } else {
-      return MediaDecoderReader::VideoQueue();
-    }
-  }
-
-  // Sets byte range for initialization (EBML); used by DASH.
-  void SetInitByteRange(MediaByteRange &aByteRange) MOZ_OVERRIDE {
-    mInitByteRange = aByteRange;
-  }
-
-  // Sets byte range for cue points, i.e. cluster offsets; used by DASH.
-  void SetIndexByteRange(MediaByteRange &aByteRange) MOZ_OVERRIDE {
-    mCuesByteRange = aByteRange;
-  }
-
-  // Returns the index of the subsegment which contains the seek time.
-  int64_t GetSubsegmentForSeekTime(int64_t aSeekToTime) MOZ_OVERRIDE;
-
-  // Returns list of ranges for cluster start and end offsets.
-  nsresult GetSubsegmentByteRanges(nsTArray<MediaByteRange>& aByteRanges)
-                                                                  MOZ_OVERRIDE;
-
-  // Called by |DASHReader|::|PossiblySwitchVideoReaders| to check if this
-  // reader has reached a switch access point and it's ok to switch readers.
-  // Called on the decode thread.
-  bool HasReachedSubsegment(uint32_t aSubsegmentIndex) MOZ_OVERRIDE;
-
-  // Requests that this reader seek to the specified subsegment. Seek will
-  // happen when |PrepareDecodeVideoFrame| is called on the decode
-  // thread.
-  // Called on the main thread or decoder thread. Decode monitor must be held.
-  void RequestSeekToSubsegment(uint32_t aIdx) MOZ_OVERRIDE;
-
-  // Requests that this reader switch to |aNextReader| at the start of the
-  // specified subsegment. This is the reader to switch FROM.
-  // Called on the main thread or decoder thread. Decode monitor must be held.
-  void RequestSwitchAtSubsegment(int32_t aSubsegmentIdx,
-                                 MediaDecoderReader* aNextReader) MOZ_OVERRIDE;
-
-  // Seeks to the beginning of the specified cluster. Called on the decode
-  // thread.
-  void SeekToCluster(uint32_t aIdx);
-
-  // Returns true if data at the end of the final subsegment has been cached.
-  bool IsDataCachedAtEndOfSubsegments() MOZ_OVERRIDE;
-#endif
-
 protected:
   // Value passed to NextPacket to determine if we are reading a video or an
   // audio packet.
   enum TrackType {
     VIDEO = 0,
     AUDIO = 1
   };
 
   // Read a packet from the nestegg file. Returns nullptr if all packets for
   // the particular track have been read. Pass VIDEO or AUDIO to indicate the
   // type of the packet we want to read.
-#ifdef MOZ_DASH
-  nsReturnRef<NesteggPacketHolder> NextPacketInternal(TrackType aTrackType);
-
-  // Read a packet from the nestegg file. Returns nullptr if all packets for
-  // the particular track have been read. Pass VIDEO or AUDIO to indicate the
-  // type of the packet we want to read. If the reader reaches a switch access
-  // point, this function will get a packet from |mNextReader|.
-#endif
   nsReturnRef<NesteggPacketHolder> NextPacket(TrackType aTrackType);
 
   // Pushes a packet to the front of the video packet queue.
   virtual void PushVideoPacket(NesteggPacketHolder* aItem);
 
   // Returns an initialized ogg packet with data obtained from the WebM container.
   ogg_packet InitOggPacket(unsigned char* aData,
                            size_t aLength,
@@ -296,61 +206,13 @@ private:
   nsIntSize mInitialFrame;
 
   // Picture region, as relative to the initial frame size.
   nsIntRect mPicture;
 
   // Booleans to indicate if we have audio and/or video data
   bool mHasVideo;
   bool mHasAudio;
-
-#ifdef MOZ_DASH
-  // Byte range for initialisation data; e.g. specified in DASH manifest.
-  MediaByteRange mInitByteRange;
-
-  // Byte range for cues; e.g. specified in DASH manifest.
-  MediaByteRange mCuesByteRange;
-
-  // Byte ranges for clusters; set internally, derived from cues.
-  nsTArray<TimestampedMediaByteRange> mClusterByteRanges;
-
-  // Pointer to the main |DASHReader|. Set in the constructor.
-  DASHReader* mMainReader;
-
-  // Index of the cluster to switch to. Monitor must be entered for write
-  // access on all threads, read access off the decode thread.
-  int32_t mSwitchingCluster;
-
-  // Pointer to the next reader. Used in |NextPacket| and |PushVideoPacket| at
-  // switch access points. Monitor must be entered for write access on all
-  // threads, read access off the decode thread.
-  nsRefPtr<WebMReader> mNextReader;
-
-  // Index of the cluster to seek to for a DASH stream request. Monitor must be
-  // entered for write access on all threads, read access off the decode
-  // thread.
-  int32_t mSeekToCluster;
-
-  // Current end offset of the last packet read in |NextPacket|. Used to check
-  // if the reader reached the switch access point. Accessed on the decode
-  // thread only.
-  int64_t mCurrentOffset;
-
-  // Index of next cluster to be read. Used to determine the starting offset of
-  // the next cluster. Accessed on the decode thread only.
-  uint32_t mNextCluster;
-
-  // Set in |NextPacket| if we read a packet from the next reader. If true in
-  // |PushVideoPacket|, we will push the packet onto the next reader's
-  // video packet queue (not video data queue!). Accessed on decode thread
-  // only.
-  bool mPushVideoPacketToNextReader;
-
-  // Indicates if the reader has reached a switch access point.  Set in
-  // |NextPacket| and read in |HasReachedSubsegment|. Accessed on
-  // decode thread only.
-  bool mReachedSwitchAccessPoint;
-#endif
 };
 
 } // namespace mozilla
 
 #endif