mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 848651 - Part 2: Log an error to the Web Console if we run out of memory while trying to resample an AudioBuffer for playback; r=padenot
This commit is contained in:
parent
a06ea67f9d
commit
fc32827507
@ -12,6 +12,7 @@
|
||||
#include "jsfriendapi.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "AudioSegment.h"
|
||||
#include "nsIScriptError.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -190,6 +191,16 @@ AudioBuffer::GetThreadSharedChannelsForRate(JSContext* aJSContext, uint32_t aRat
|
||||
}
|
||||
float* outputData = static_cast<float*>(malloc(uint32_t(size)));
|
||||
if (!outputData) {
|
||||
nsCOMPtr<nsPIDOMWindow> pWindow = do_QueryInterface(mContext->GetParentObject());
|
||||
nsIDocument* doc = nullptr;
|
||||
if (pWindow) {
|
||||
doc = pWindow->GetExtantDoc();
|
||||
}
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
|
||||
"Media",
|
||||
doc,
|
||||
nsContentUtils::eDOM_PROPERTIES,
|
||||
"MediaBufferSourceNodeResampleOutOfMemory");
|
||||
return mResampledChannels;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@ ResponseTypeSyncXHRWarning=Use of XMLHttpRequest's responseType attribute is no
|
||||
WithCredentialsSyncXHRWarning=Use of XMLHttpRequest's withCredentials attribute is no longer supported in the synchronous mode in window context.
|
||||
TimeoutSyncXHRWarning=Use of XMLHttpRequest's timeout attribute is not supported in the synchronous mode in window context.
|
||||
JSONCharsetWarning=An attempt was made to declare a non-UTF-8 encoding for JSON retrieved using XMLHttpRequest. Only UTF-8 is supported for decoding JSON.
|
||||
MediaBufferSourceNodeResampleOutOfMemory=Insufficient memory to resample the AudioBufferSourceNode for playback.
|
||||
# LOCALIZATION NOTE: Do not translate decodeAudioData.
|
||||
MediaDecodeAudioDataUnknownContentType=The buffer passed to decodeAudioData contains an unknown content type.
|
||||
# LOCALIZATION NOTE: Do not translate decodeAudioData.
|
||||
|
Loading…
Reference in New Issue
Block a user