Bug 1044498 - Pass saved init segment to decoder's NotifyDataAvailable. r=cajbir
authorMatthew Gregan <kinetik@flim.org>
Wed, 27 Aug 2014 18:15:36 +1200
changeset 223935 756ce4591f679db1c0511491b2fbb4d398f1f376
parent 223934 8a69a71936ce6ae2e422fe9b2705f613a8238812
child 223936 169a90f344da7aa8d98dd50954a0846ca58df64f
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs1044498
milestone34.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 1044498 - Pass saved init segment to decoder's NotifyDataAvailable. r=cajbir
content/media/mediasource/SourceBuffer.cpp
content/media/webm/WebMBufferedParser.cpp
--- a/content/media/mediasource/SourceBuffer.cpp
+++ b/content/media/mediasource/SourceBuffer.cpp
@@ -585,16 +585,19 @@ SourceBuffer::AppendData(const uint8_t* 
       // rather than creating a new one.
       if (!InitNewDecoder()) {
         aRv.Throw(NS_ERROR_FAILURE); // XXX: Review error handling.
         return;
       }
       MSE_DEBUG("SourceBuffer(%p)::AppendData: Decoder marked as initialized.", this);
       mDecoderInitialized = true;
       const nsTArray<uint8_t>& initData = mParser->InitData();
+      mDecoder->NotifyDataArrived(reinterpret_cast<const char*>(initData.Elements()),
+                                  initData.Length(),
+                                  0);
       mDecoder->GetResource()->AppendData(initData.Elements(), initData.Length());
     }
     mLastParsedTimestamp = end;
     MSE_DEBUG("SourceBuffer(%p)::AppendData: Segment start=%f end=%f", this, start, end);
   }
   // XXX: For future reference: NDA call must run on the main thread.
   mDecoder->NotifyDataArrived(reinterpret_cast<const char*>(aData),
                               aLength,
--- a/content/media/webm/WebMBufferedParser.cpp
+++ b/content/media/webm/WebMBufferedParser.cpp
@@ -122,16 +122,17 @@ void WebMBufferedParser::Append(const un
         mVInt.mValue <<= 8;
         mVInt.mValue |= *p++;
         mVIntLeft -= 1;
       } else {
         mState = mNextState;
       }
       break;
     case READ_TIMECODESCALE:
+      MOZ_ASSERT(mGotTimecodeScale);
       mTimecodeScale = mVInt.mValue;
       mState = READ_ELEMENT_ID;
       break;
     case READ_CLUSTER_TIMECODE:
       mClusterTimecode = mVInt.mValue;
       mState = READ_ELEMENT_ID;
       break;
     case READ_BLOCK_TIMECODE: