Bug 1271491: [ffmpeg] P4. Remove requirements to call Init on the main thread. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 10 May 2016 17:28:47 +1000
changeset 297375 076253655f65b4b8392aff615c318b64c525bbb0
parent 297374 d645ebd74e86e7a7a7a2100ba7be090ace750420
child 297376 30e33b58645e4fc094fb8fec341f78b1ac41ed5c
push id19218
push userkwierso@gmail.com
push dateFri, 13 May 2016 23:46:15 +0000
treeherderfx-team@93d60e9db618 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1271491
milestone49.0a1
Bug 1271491: [ffmpeg] P4. Remove requirements to call Init on the main thread. r=cpearce FFMpegRuntimeLinker/FFVPXRuntimeLinker::Init() aren't thread safe, but they can be called on any threads. MozReview-Commit-ID: 4B9yn7zSyf1
dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
@@ -43,17 +43,16 @@ static const char* sLibs[] = {
 };
 
 /* static */ bool
 FFmpegRuntimeLinker::Init()
 {
   if (sLinkStatus) {
     return sLinkStatus == LinkStatus_SUCCEEDED;
   }
-  MOZ_ASSERT(NS_IsMainThread());
 
   for (size_t i = 0; i < ArrayLength(sLibs); i++) {
     const char* lib = sLibs[i];
     PRLibSpec lspec;
     lspec.type = PR_LibSpec_Pathname;
     lspec.value.pathname = lib;
     sLibAV.mAVCodecLib = PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
     if (sLibAV.mAVCodecLib) {
--- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -44,17 +44,16 @@ 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 lgpllibs library as this is where mozavcodec
   // and mozavutil libs are located.
   char* lgpllibsname = PR_GetLibraryName(nullptr, "lgpllibs");
   if (!lgpllibsname) {
     return false;
   }