| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/www/firefox/files/ |
Upload File : |
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.
--- dom/media/AudioStream.cpp.orig 2022-09-08 21:05:37.835865000 +0200
+++ dom/media/AudioStream.cpp 2022-09-08 21:12:51.417935000 +0200
@@ -27,7 +27,6 @@
#endif
#include "Tracing.h"
#include "webaudio/blink/DenormalDisabler.h"
-#include "AudioThreadRegistry.h"
#include "mozilla/StaticPrefs_media.h"
// Use abort() instead of exception in SoundTouch.
@@ -144,8 +143,6 @@
mOutChannels(aOutputChannels),
mState(INITIALIZED),
mDataSource(aSource),
- mAudioThreadId(ProfilerThreadId{}),
- mSandboxed(CubebUtils::SandboxEnabled()),
mPlaybackComplete(false),
mPlaybackRate(1.0f),
mPreservesPitch(true),
@@ -554,17 +551,6 @@
aWriter.Available());
}
-bool AudioStream::CheckThreadIdChanged() {
- ProfilerThreadId id = profiler_current_thread_id();
- if (id != mAudioThreadId) {
- mAudioThreadId = id;
- mAudioThreadChanged = true;
- return true;
- }
- mAudioThreadChanged = false;
- return false;
-}
-
void AudioStream::AssertIsOnAudioThread() const {
// This can be called right after CheckThreadIdChanged, because the audio
// thread can change when not sandboxed.
@@ -593,9 +579,6 @@
}
long AudioStream::DataCallback(void* aBuffer, long aFrames) {
- if (CheckThreadIdChanged() && !mSandboxed) {
- CubebUtils::GetAudioThreadRegistry()->Register(mAudioThreadId);
- }
WebCore::DenormalDisabler disabler;
if (!mCallbacksStarted) {
mCallbacksStarted = true;
@@ -653,9 +636,6 @@
mDumpFile.Write(static_cast<const AudioDataValue*>(aBuffer),
aFrames * mOutChannels);
- if (!mSandboxed && writer.Available() != 0) {
- CubebUtils::GetAudioThreadRegistry()->Unregister(mAudioThreadId);
- }
return aFrames - writer.Available();
}
--- dom/media/AudioStream.h.orig 2022-09-08 21:13:08.562133000 +0200
+++ dom/media/AudioStream.h 2022-09-08 21:15:22.121196000 +0200
@@ -339,7 +339,6 @@
template <typename Function, typename... Args>
int InvokeCubeb(Function aFunction, Args&&... aArgs) MOZ_REQUIRES(mMonitor);
- bool CheckThreadIdChanged();
void AssertIsOnAudioThread() const;
soundtouch::SoundTouch* mTimeStretcher;
@@ -378,9 +377,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<ProfilerThreadId> mAudioThreadId;
- const bool mSandboxed = false;
MozPromiseHolder<MediaSink::EndedPromise> mEndedPromise
MOZ_GUARDED_BY(mMonitor);