Bug 1243627 - FFVPXRuntimeLinker::Init() should set sLinkStatus to LinkStatus_FAILED before returning false. r=jya.
authorJW Wang <jwwang@mozilla.com>
Fri, 29 Jan 2016 10:47:32 +0800
changeset 282292 d74069d5dd462cc11a684376c05cc890b4fddab4
parent 282291 c6b99ed4cd7936fca3c9d8d9988217ba2acf0811
child 282293 180ed3d82d7756f96023a33f30d22d7cbff7f99a
push id29955
push userkwierso@gmail.com
push dateFri, 29 Jan 2016 21:12:10 +0000
treeherdermozilla-central@08eddf3af531 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1243627
milestone47.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 1243627 - FFVPXRuntimeLinker::Init() should set sLinkStatus to LinkStatus_FAILED before returning false. r=jya.
dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
--- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -38,16 +38,17 @@ MozAVLink(const char* aName)
 /* static */ bool
 FFVPXRuntimeLinker::Init()
 {
   if (sLinkStatus) {
     return sLinkStatus == LinkStatus_SUCCEEDED;
   }
 
   MOZ_ASSERT(NS_IsMainThread());
+  sLinkStatus = LinkStatus_FAILED;
 
   // We retrieve the path of the XUL library as this is where mozavcodec and
   // mozavutil libs are located.
   char* path =
     PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init);
   if (!path) {
     return false;
   }
@@ -80,18 +81,16 @@ FFVPXRuntimeLinker::Init()
   if (libname) {
     sFFVPXLib.mAVCodecLib = MozAVLink(libname);
     PR_FreeLibraryName(libname);
   }
   if (sFFVPXLib.Link()) {
     sLinkStatus = LinkStatus_SUCCEEDED;
     return true;
   }
-  sLinkStatus = LinkStatus_FAILED;
-
   return false;
 }
 
 /* static */ already_AddRefed<PlatformDecoderModule>
 FFVPXRuntimeLinker::CreateDecoderModule()
 {
   if (!Init()) {
     return nullptr;