Bug 1193864 - Fixed dom/media/platforms/wmf/ compilation on mingw. r=cpearce
authorJacek Caban <jacek@codeweavers.com>
Thu, 13 Aug 2015 17:37:40 +0200
changeset 257597 06f4591f8142ecd41089957686351eb9f18ff8f9
parent 257596 3341eda2963a1678b85deecaa790dbe71c963aa8
child 257598 02d10fc80c18619b3f4d180dde166aa8cb296d17
push id63673
push userjacek@codeweavers.com
push dateThu, 13 Aug 2015 15:37:03 +0000
treeherdermozilla-inbound@02d10fc80c18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1193864
milestone43.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 1193864 - Fixed dom/media/platforms/wmf/ compilation on mingw. r=cpearce
dom/media/platforms/wmf/MFTDecoder.cpp
dom/media/platforms/wmf/WMFDecoderModule.cpp
dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
--- a/dom/media/platforms/wmf/MFTDecoder.cpp
+++ b/dom/media/platforms/wmf/MFTDecoder.cpp
@@ -175,20 +175,16 @@ MFTDecoder::CreateOutputSample(RefPtr<IM
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   RefPtr<IMFMediaBuffer> buffer;
   int32_t bufferSize = mOutputStreamInfo.cbSize;
   UINT32 alignment = (mOutputStreamInfo.cbAlignment > 1) ? mOutputStreamInfo.cbAlignment - 1 : 0;
   hr = wmf::MFCreateAlignedMemoryBuffer(bufferSize, alignment, byRef(buffer));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
-  DWORD maxLength = 0;
-  DWORD currentLength = 0;
-  BYTE* dst = nullptr;
-
   hr = sample->AddBuffer(buffer);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   *aOutSample = sample.forget();
 
   return S_OK;
 }
 
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -93,21 +93,21 @@ WMFDecoderModule::Startup()
 
 already_AddRefed<MediaDataDecoder>
 WMFDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig,
                                      layers::LayersBackend aLayersBackend,
                                      layers::ImageContainer* aImageContainer,
                                      FlushableTaskQueue* aVideoTaskQueue,
                                      MediaDataDecoderCallback* aCallback)
 {
-  nsAutoPtr<WMFVideoMFTManager> manager =
+  nsAutoPtr<WMFVideoMFTManager> manager(
     new WMFVideoMFTManager(aConfig,
                            aLayersBackend,
                            aImageContainer,
-                           sDXVAEnabled && ShouldUseDXVA(aConfig));
+                           sDXVAEnabled && ShouldUseDXVA(aConfig)));
 
   nsRefPtr<MFTDecoder> mft = manager->Init();
 
   if (!mft) {
     return nullptr;
   }
 
   nsRefPtr<MediaDataDecoder> decoder =
@@ -116,17 +116,17 @@ WMFDecoderModule::CreateVideoDecoder(con
   return decoder.forget();
 }
 
 already_AddRefed<MediaDataDecoder>
 WMFDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig,
                                      FlushableTaskQueue* aAudioTaskQueue,
                                      MediaDataDecoderCallback* aCallback)
 {
-  nsAutoPtr<WMFAudioMFTManager> manager = new WMFAudioMFTManager(aConfig);
+  nsAutoPtr<WMFAudioMFTManager> manager(new WMFAudioMFTManager(aConfig));
   nsRefPtr<MFTDecoder> mft = manager->Init();
 
   if (!mft) {
     return nullptr;
   }
 
   nsRefPtr<MediaDataDecoder> decoder =
     new WMFMediaDataDecoder(manager.forget(), mft, aAudioTaskQueue, aCallback);
--- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
+++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
@@ -43,17 +43,17 @@ WMFMediaDataDecoder::Init()
   return mDecoder ?
            InitPromise::CreateAndResolve(mMFTManager->GetType(), __func__) :
            InitPromise::CreateAndReject(MediaDataDecoder::DecoderFailureReason::INIT_ERROR, __func__);
 }
 
 // A single telemetry sample is reported for each MediaDataDecoder object
 // that has detected error or produced output successfully.
 static void
-SendTelemetry(HRESULT hr)
+SendTelemetry(unsigned long hr)
 {
   // Collapse the error codes into a range of 0-0xff that can be viewed in
   // telemetry histograms.  For most MF_E_* errors, unique samples are used,
   // retaining the least significant 7 or 8 bits.  Other error codes are
   // bucketed.
   uint32_t sample;
   if (SUCCEEDED(hr)) {
     sample = 0;