Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Sep 2020 00:37:31 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r548266 - in head/www/firefox: . files
Message-ID:  <202009120037.08C0bVtM072495@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Sep 12 00:37:31 2020
New Revision: 548266
URL: https://svnweb.freebsd.org/changeset/ports/548266

Log:
  www/firefox: fix tab crashing when not using pulseaudio
  
  Submitted by:	Ka Ho Ng
  Differential Revision:	https://reviews.freebsd.org/D26303

Added:
  head/www/firefox/files/patch-bug1664115   (contents, props changed)
Modified:
  head/www/firefox/Makefile   (contents, props changed)

Modified: head/www/firefox/Makefile
==============================================================================
--- head/www/firefox/Makefile	Fri Sep 11 22:43:56 2020	(r548265)
+++ head/www/firefox/Makefile	Sat Sep 12 00:37:31 2020	(r548266)
@@ -3,7 +3,7 @@
 
 PORTNAME=	firefox
 DISTVERSION=	80.0.1
-PORTEPOCH=	1
+PORTEPOCH=	2
 CATEGORIES=	www
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
 		MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source

Added: head/www/firefox/files/patch-bug1664115
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1664115	Sat Sep 12 00:37:31 2020	(r548266)
@@ -0,0 +1,82 @@
+Revert bug 1647717 to workaround the issue of occational tab crashing when
+using any cubeb backends other than pulse-rust to play media. The loss of
+such change will be that users will not be able to do profiling on threads
+created by libcubeb.
+
+diff --git dom/media/AudioStream.cpp dom/media/AudioStream.cpp
+index 1b62a26ab32b2..35c61f612bf72 100644
+--- dom/media/AudioStream.cpp
++++ dom/media/AudioStream.cpp
+@@ -25,7 +25,6 @@
+ #endif
+ #include "Tracing.h"
+ #include "webaudio/blink/DenormalDisabler.h"
+-#include "AudioThreadRegistry.h"
+ 
+ // Use abort() instead of exception in SoundTouch.
+ #define ST_NO_EXCEPTION_HANDLING 1
+@@ -138,9 +137,7 @@
+       mTimeStretcher(nullptr),
+       mState(INITIALIZED),
+       mDataSource(aSource),
+-      mPrefillQuirk(false),
+-      mAudioThreadId(0),
+-      mSandboxed(CubebUtils::SandboxEnabled()) {
++      mPrefillQuirk(false) {
+ #if defined(XP_WIN)
+   if (XRE_IsContentProcess()) {
+     audio::AudioNotificationReceiver::Register(this);
+@@ -587,21 +584,7 @@
+       aWriter.Available());
+ }
+ 
+-bool AudioStream::CheckThreadIdChanged() {
+-#ifdef MOZ_GECKO_PROFILER
+-  auto id = profiler_current_thread_id();
+-  if (id != mAudioThreadId) {
+-    mAudioThreadId = id;
+-    return true;
+-  }
+-#endif
+-  return false;
+-}
+-
+ long AudioStream::DataCallback(void* aBuffer, long aFrames) {
+-  if (!mSandboxed && CheckThreadIdChanged()) {
+-    CubebUtils::GetAudioThreadRegistry()->Register(mAudioThreadId);
+-  }
+   WebCore::DenormalDisabler disabler;
+ 
+   TRACE_AUDIO_CALLBACK_BUDGET(aFrames, mAudioClock.GetInputRate());
+@@ -657,9 +640,6 @@
+   mDumpFile.Write(static_cast<const AudioDataValue*>(aBuffer),
+                   aFrames * mOutChannels);
+ 
+-  if (!mSandboxed && writer.Available() != 0) {
+-    CubebUtils::GetAudioThreadRegistry()->Unregister(mAudioThreadId);
+-  }
+   return aFrames - writer.Available();
+ }
+ 
+diff --git dom/media/AudioStream.h dom/media/AudioStream.h
+index 933e4cb3bfdb5..5d2181e632af9 100644
+--- dom/media/AudioStream.h
++++ dom/media/AudioStream.h
+@@ -304,7 +304,6 @@
+ 
+   template <typename Function, typename... Args>
+   int InvokeCubeb(Function aFunction, Args&&... aArgs);
+-  bool CheckThreadIdChanged();
+ 
+   // The monitor is held to protect all access to member variables.
+   Monitor mMonitor;
+@@ -338,9 +337,6 @@
+   // the default device is used. It is set
+   // during the Init() in decoder thread.
+   RefPtr<AudioDeviceInfo> mSinkInfo;
+-  /* Contains the id of the audio thread, from profiler_get_thread_id. */
+-  std::atomic<int> mAudioThreadId;
+-  const bool mSandboxed = false;
+ };
+ 
+ }  // namespace mozilla



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009120037.08C0bVtM072495>