Open Bug 2089482 Opened 2 days ago Updated 2 days ago

Microphones are enumerated twice when cameras are enumerated

Categories

(Core :: Audio/Video, defect)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- wontfix
firefox-esr153 --- affected
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 --- affected

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

MediaManager::EnumerateRawDevices tries to reuse the microphone list for camera groupId correlation when audio and video use the same backend (micsOfVideoBackend). Since bug 1528042 moved microphone enumeration before cameras, audioBackend == videoBackend is evaluated before videoBackend is assigned, so it is always false and the microphones are enumerated a second time for every camera enumeration (enumerateDevices(), getUserMedia()).

Fix: pick videoBackend before the audio block. The existing MOZ_ASSERT on the forced microphone name in the reuse path holds, because both names come from the same media.audio_loopback_dev read.

Performance only. Found by Coverity Scan (CID 1559893, reported as a dereference after null check).

Since microphones are enumerated before cameras, audioBackend was
compared with a still-null videoBackend, so the microphone list was never
reused for camera groupId correlation and was enumerated a second time.

Assignee: nobody → sledru
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 1528042

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: