Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 950d6f1

Browse files
author
Jean-Yves Avenard
committed
Bug 1670560 - Don't use the same thread pool for both decoding and waiting for the decode to complete. r=mattwoodrow
Unlikely to happen, but we could have exhausted all our thread in the decoder thread pool and be deadlock. Differential Revision: https://phabricator.services.mozilla.com/D93202
1 parent 5a9ad19 commit 950d6f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dom/media/webrtc/libwebrtcglue/WebrtcMediaDataDecoderCodec.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace mozilla {
1717

1818
WebrtcMediaDataDecoder::WebrtcMediaDataDecoder()
19-
: mThreadPool(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)),
19+
: mThreadPool(GetMediaThreadPool(MediaThreadType::CONTROLLER)),
2020
mTaskQueue(new TaskQueue(do_AddRef(mThreadPool),
2121
"WebrtcMediaDataDecoder::mTaskQueue")),
2222
mImageContainer(layers::LayerManager::CreateImageContainer(
@@ -170,8 +170,11 @@ int32_t WebrtcMediaDataDecoder::CreateDecoder() {
170170

171171
// We need to wrap our decoder in a MediaDataDecoderProxy so that it always
172172
// run on an nsISerialEventTarget (which the webrtc code doesn't do)
173-
mDecoder =
174-
new MediaDataDecoderProxy(decoder.forget(), do_AddRef(mTaskQueue.get()));
173+
mDecoder = new MediaDataDecoderProxy(
174+
decoder.forget(),
175+
MakeAndAddRef<TaskQueue>(
176+
GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER),
177+
"webrtc decode TaskQueue"));
175178

176179
media::Await(
177180
do_AddRef(mThreadPool), mDecoder->Init(),

0 commit comments

Comments
 (0)