Backed out changeset d32e0a4ff68c (bug 1314863) on request from jya
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 10 Nov 2016 11:02:32 +0100
changeset 348572 324fdf1165e8ae5bd57cb91e5aca3daf083d57a7
parent 348571 47f86091deddd87636138843bad95f3168637217
child 348573 827b1805b72469f2612649b41df015359777fe0a
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1314863
milestone52.0a1
backs outd32e0a4ff68cf2aba67bd48a3c356d3d5e464fae
Backed out changeset d32e0a4ff68c (bug 1314863) on request from jya
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -81,21 +81,16 @@ H264Converter::Input(MediaRawData* aSamp
     if (rv == NS_ERROR_NOT_INITIALIZED) {
       // We are missing the required SPS to create the decoder.
       // Ignore for the time being, the MediaRawData will be dropped.
       mCallback->InputExhausted();
       return;
     }
   } else {
     rv = CheckForSPSChange(aSample);
-    if (rv == NS_ERROR_NOT_INITIALIZED) {
-      // Decoder has not yet initialized.
-      mCallback->InputExhausted();
-      return;
-    }
   }
   if (NS_FAILED(rv)) {
     mCallback->Error(
       MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                   RESULT_DETAIL("Unable to create H264 decoder")));
     return;
   }
 
@@ -229,38 +224,32 @@ H264Converter::CreateDecoderAndInit(Medi
     // Queue the incoming sample.
     mMediaRawSamples.AppendElement(aSample);
 
     mInitPromiseRequest.Begin(mDecoder->Init()
       ->Then(AbstractThread::GetCurrent()->AsTaskQueue(), __func__, this,
              &H264Converter::OnDecoderInitDone,
              &H264Converter::OnDecoderInitFailed));
   }
-  return NS_ERROR_NOT_INITIALIZED;
+  return rv;
 }
 
 void
 H264Converter::OnDecoderInitDone(const TrackType aTrackType)
 {
   mInitPromiseRequest.Complete();
   bool gotInput = false;
   for (uint32_t i = 0 ; i < mMediaRawSamples.Length(); i++) {
     const RefPtr<MediaRawData>& sample = mMediaRawSamples[i];
     if (mNeedKeyframe) {
       if (!sample->mKeyframe) {
         continue;
       }
       mNeedKeyframe = false;
     }
-    if (!mNeedAVCC &&
-        !mp4_demuxer::AnnexB::ConvertSampleToAnnexB(sample, mNeedKeyframe)) {
-      mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY,
-                                   RESULT_DETAIL("ConvertSampleToAnnexB")));
-      return;
-    }
     mDecoder->Input(sample);
   }
   if (!gotInput) {
     mCallback->InputExhausted();
   }
   mMediaRawSamples.Clear();
 }