[webrtc-pc] Handling of invalid characters in the tone buffer is broken

bzbarsky has just created a new issue for 
https://github.com/w3c/webrtc-pc:

== Handling of invalid characters in the tone buffer is broken ==
Consider the following operations on a `RTCDTMFSender` named `sender`:

    sender.insertDTMF("ABCD");
    setTimeout(function() {
      sender.insertDTMD("ZZZZ");
    }, 200);

Stepping through 
<https://www.w3.org/TR/webrtc/#dom-rtcdtmfsender-insertdtmf>, the 
first time we set the `toneBuffer` to "ABCD", and queue a playout 
task.  Let's call this time 0.

The playout task runs, pops the "A" from `toneBuffer`, starts playout 
of it, schedules another playout task for time 170ms.

At time 170ms, the second playout task runs, pops the "B" from 
`toneBuffer`, starts playout, schedules another playout task for time 
340ms.

At time 200ms the timeout fires and `insertDTMF` is called again.  It 
sets `toneBuffer` to "ZZZZ" and then throws an exception.

At time 340ms the third playout task runs, pops the "Z" from 
`toneBuffer`, start playout... what does that mean, exactly?

Please view or discuss this issue at 
https://github.com/w3c/webrtc-pc/issues/775 using your GitHub account

Received on Friday, 26 August 2016 13:47:45 UTC