Bug 1276572: [webm] Fix MediaRawDataQueue::PushFront. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 30 May 2016 19:17:03 +1000
changeset 338569 20da5975be4d4da7899e51db42f9c64b74666dea
parent 338568 4af4438a2aecac6fd61c94c62f2c78957b451fc0
child 338570 0149fb3567b4f2160dcdc2e918e73e4a42f33106
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1276572
milestone49.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 1276572: [webm] Fix MediaRawDataQueue::PushFront. r=jwwang We want to add MediaRawDataQueue aOther at the front, not at the back. MozReview-Commit-ID: 9icTWzRqS4u
dom/media/webm/WebMDemuxer.h
--- a/dom/media/webm/WebMDemuxer.h
+++ b/dom/media/webm/WebMDemuxer.h
@@ -37,26 +37,32 @@ class MediaRawDataQueue {
   }
 
   void PushFront(already_AddRefed<MediaRawData>&& aItem) {
     mQueue.push_front(Move(aItem));
   }
 
   void PushFront(MediaRawDataQueue&& aOther) {
     while (!aOther.mQueue.empty()) {
-      Push(aOther.PopFront());
+      PushFront(aOther.Pop());
     }
   }
 
   already_AddRefed<MediaRawData> PopFront() {
     RefPtr<MediaRawData> result = mQueue.front().forget();
     mQueue.pop_front();
     return result.forget();
   }
 
+  already_AddRefed<MediaRawData> Pop() {
+    RefPtr<MediaRawData> result = mQueue.back().forget();
+    mQueue.pop_back();
+    return result.forget();
+  }
+
   void Reset() {
     while (!mQueue.empty()) {
       mQueue.pop_front();
     }
   }
 
   MediaRawDataQueue& operator=(const MediaRawDataQueue& aOther) {
     mQueue = aOther.mQueue;