fix(libwebrtc): build the Opus decoder on macOS #27621
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27621"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by magnub on 2026-11-26T19:36:31Z.
What
AudioDecoderOpusImpl::GeneratePlc(from #21347) grew the buffer withstd::max(newSize, hostBuffer.capacity + hostBuffer.capacity / 2), wherenewSizeis astd::size_tandcapacityastd::uint64_t. Both areunsigned longon Linux, but on macOSstd::uint64_tisunsigned long long.std::maxthen cannot deduce one type, solibwebrtcand every target linking it fail to build ("no matching function for call to 'max' ... deduced conflicting types for parameter '_Tp' ('std::size_t' (aka 'unsigned long') vs. 'std::uint64_t' (aka 'unsigned long long'))"). The call now namesstd::size_t, asHistoryItem.cppdoes for its own growth. No behaviour change on 64-bit hosts.Tested
macOS 27.0.1 (26A434) on an Apple M1 Pro, Apple clang 21.0.0, x86_64 Release build under Rosetta 2. Build:
maindebacdd4d9plus #17425, #11049, #26739 and #25331, which the macOS build needs:guest_webrtc_audio_decoder_opus_testsfails to build with the error above.guest_webrtc_audio_decoder_opuspasses 3/3 (2.09 / 0.06 / 0.06 s).The same
unsigned long/unsigned long longpair reproduces the error with GCC 13 on Ubuntu 24.04, and the fixed call compiles there.tools/check_conventions.py --base origin/mainpasses. Log attached.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_012LL9hfx4BY6MbUCYMduDAQ
verify-two.log
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T19:48:15Z.
Review: APPROVED
Reviewed — looks good
The change makes the buffer-growth
std::maxcall compile when its arguments have different unsigned integer types, and I found no defect in the reviewed change.What I ran
Reviewed head
159a2741d1f0df9ee90fae28da2ea0524887f58busing the prepared diff andrepo_read.pyfor the changed function. No build or tests were run in this review; the build and test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full changed file was not read; only lines 1–35 and 535–600 were read.
files.jsonwas unavailable through the reader, so excluded files could not be confirmed. No build or tests were run locally.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Romannachwievor on 2026-11-26T21:54:56Z.
Review: COMMENTED
Tested on an Apple M1, macOS 26.5, AppleClang 21.0.0, Release with
CMAKE_OSX_ARCHITECTURES=x86_64(runs under Rosetta) andBUILD_TESTING=ON.Base is main
eb2e3e1cf7plus local merges of #17425, #11049 and #26739, which a full macOS build needs.On that base libwebrtc fails with
core/libs/prx/libwebrtc/src/AudioDecoderOpusImpl.cpp:576:41: error: no matching function for call to 'max'.I applied a one-line change identical to this diff (
std::max<std::size_t>(...)) as a local commit on that base, not the PR head159a2741d1itself. After the incremental rebuild libwebrtc builds; the only remaining failure is the unrelatedPipelinedFlushReadOrder.cpptest, which fails on main as well.ctest -R webrtc: 127/127 passed. Linux and Windows not run.