summaryrefslogtreecommitdiffstats
path: root/dom/media/webspeech/recognition
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/webspeech/recognition
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webspeech/recognition')
-rw-r--r--dom/media/webspeech/recognition/SpeechRecognition.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp
index 75d1ba7709..7239a88237 100644
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -437,12 +437,13 @@ uint32_t SpeechRecognition::ProcessAudioSegment(AudioSegment* aSegment,
// we need to call the nsISpeechRecognitionService::ProcessAudioSegment
// in a separate thread so that any eventual encoding or pre-processing
// of the audio does not block the main thread
- nsresult rv = mEncodeTaskQueue->Dispatch(
- NewRunnableMethod<StoreCopyPassByPtr<AudioSegment>, TrackRate>(
- "nsISpeechRecognitionService::ProcessAudioSegment",
- mRecognitionService,
- &nsISpeechRecognitionService::ProcessAudioSegment,
- std::move(*aSegment), aTrackRate));
+ nsresult rv = mEncodeTaskQueue->Dispatch(NS_NewRunnableFunction(
+ "nsISpeechRecognitionService::ProcessAudioSegment",
+ [=, service = mRecognitionService,
+ segment = std::move(*aSegment)]() mutable {
+ service->ProcessAudioSegment(&segment, aTrackRate);
+ }));
+
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
Unused << rv;
return samples;