Bug 1588233 - P2: Set ST_NO_EXCEPTION_HANDLING before using SoundTouch. r=glandium
authorChun-Min Chang <chun.m.chang@gmail.com>
Tue, 26 Nov 2019 00:48:24 +0000
changeset 503779 1d46f9bfcab5b4a9101be0d0163d0ca2eefa5c6a
parent 503778 2731c91357d9346249404e00707d1420d9207b23
child 503780 41cd531e5e837a1aee11aa7ae317c386dd5c166a
push id101544
push userccoroiu@mozilla.com
push dateTue, 26 Nov 2019 00:57:38 +0000
treeherderautoland@41cd531e5e83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1588233
milestone72.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 1588233 - P2: Set ST_NO_EXCEPTION_HANDLING before using SoundTouch. r=glandium The coming updated libsoundtouch will use ST_THROW_RT_ERROR in several places built without setting ST_NO_EXCEPTION_HANDLING. ST_NO_EXCEPTION_HANDLING is only set in libsoundtouch/src/moz.build. To avoid using `throw`, we should `#define` ST_NO_EXCEPTION_HANDLING before `#include` soundtouch headers. Differential Revision: https://phabricator.services.mozilla.com/D52932
dom/media/AudioStream.cpp
dom/media/AudioStream.h
dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -20,16 +20,20 @@
 #include "nsPrintfCString.h"
 #include "AudioConverter.h"
 #include "UnderrunHandler.h"
 #if defined(XP_WIN)
 #  include "nsXULAppAPI.h"
 #endif
 #include "Tracing.h"
 
+// Use abort() instead of exception in SoundTouch.
+#define ST_NO_EXCEPTION_HANDLING 1
+#include "soundtouch/SoundTouchFactory.h"
+
 namespace mozilla {
 
 #undef LOG
 #undef LOGW
 #undef LOGE
 
 LazyLogModule gAudioStreamLog("AudioStream");
 // For simple logs
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -11,23 +11,26 @@
 #  include "MediaInfo.h"
 #  include "mozilla/Monitor.h"
 #  include "mozilla/RefPtr.h"
 #  include "mozilla/TimeStamp.h"
 #  include "mozilla/UniquePtr.h"
 #  include "nsAutoPtr.h"
 #  include "nsCOMPtr.h"
 #  include "nsThreadUtils.h"
-#  include "soundtouch/SoundTouchFactory.h"
 #  include "WavDumper.h"
 
 #  if defined(XP_WIN)
 #    include "mozilla/audio/AudioNotificationReceiver.h"
 #  endif
 
+namespace soundtouch {
+class MOZ_EXPORT SoundTouch;
+}
+
 namespace mozilla {
 
 struct CubebDestroyPolicy {
   void operator()(cubeb_stream* aStream) const {
     cubeb_stream_destroy(aStream);
   }
 };
 
--- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -12,16 +12,18 @@
 #include "prmem.h"
 #include "prlink.h"
 #ifdef XP_WIN
 #  include <windows.h>
 #endif
 
 // We use a known symbol located in lgpllibs to determine its location.
 // soundtouch happens to be always included in lgpllibs
+// Use abort() instead of exception in SoundTouch.
+#define ST_NO_EXCEPTION_HANDLING 1
 #include "soundtouch/SoundTouch.h"
 
 namespace mozilla {
 
 template <int V>
 class FFmpegDecoderModule {
  public:
   static already_AddRefed<PlatformDecoderModule> Create(FFmpegLibWrapper*);