Repository navigation
RTCDTMFSender: interToneGap is not clamped to 6000 ms and is waited twice between tones - #78217
Open
Ahmad-S792 wants to merge 1 commit into
Conversation
…wice between tones https://bugs.webkit.org/show_bug.cgi?id=328831 rdar://190946556 Reviewed by NOBODY (OOPS!). This patch aligns WebKit with Gecko / Firefox. Per the WebRTC spec [1], insertDTMF() sets [[InterToneGap]] to 6000 ms if the given value is greater than 6000 ms, in addition to raising values below 30 ms to 30 ms. We only applied the lower bound, so a large interToneGap was used as is. Clamp it to [30, 6000] with std::clamp, and use std::clamp for duration as well so both lines match. The spec also queues the next playout task duration + interToneGap after a tone starts. We waited the gap twice: libwebrtc's DtmfSender already waits duration + gap before reporting the tone as played, and then RTCDTMFSender::onTonePlayed() started a further interToneGap timer before playing the next tone, so each tone took duration + 2 * interToneGap. Play the next tone directly from onTonePlayed() and remove the timer. [1] https://w3c.github.io/webrtc-pc/#dom-RTCDTMFSender-insertDTMF * LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDTMFSender-ontonechange-long.https.html: Added new tests * LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDTMFSender-ontonechange-long.https-expected.txt: Updated Expectation * Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp: (WebCore::RTCDTMFSender::RTCDTMFSender): (WebCore::RTCDTMFSender::insertDTMF): (WebCore::RTCDTMFSender::onTonePlayed): (WebCore::RTCDTMFSender::stop): (WebCore::RTCDTMFSender::toneTimerFired): Deleted. * Source/WebCore/Modules/mediastream/RTCDTMFSender.h:
Collaborator
|
EWS run on current version of this PR (hash cfab9c6) Details
|
Ahmad-S792
marked this pull request as ready for review
October 25, 2026 17:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cfab9c6
cfab9c6