Skip to content

Commit

Permalink
Bug 1453030 - Only create RTCDTMFSender on audio RTCRtpSender senders…
Browse files Browse the repository at this point in the history
…; r=bwc

MozReview-Commit-ID: KsnUYCs8IYU

--HG--
extra : rebase_source : 2bee2f713ef65ef5baaa6cd37a3f9521beaa9a73
  • Loading branch information
dminor committed Apr 10, 2018
1 parent e4e06ef commit 30d5029
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dom/media/PeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1915,9 +1915,11 @@ setupPrototype(RTCDTMFSender, {
});

class RTCRtpSender {
constructor(pc, transceiverImpl, transceiver, track, streams) {
let dtmf = pc._win.RTCDTMFSender._create(
pc._win, new RTCDTMFSender(this));
constructor(pc, transceiverImpl, transceiver, track, kind, streams) {
let dtmf = null;
if (kind == "audio") {
dtmf = pc._win.RTCDTMFSender._create(pc._win, new RTCDTMFSender(this));
}

Object.assign(this, {
_pc: pc,
Expand Down Expand Up @@ -2225,7 +2227,7 @@ class RTCRtpTransceiver {
pc._win, new RTCRtpReceiver(pc, transceiverImpl, kind));
let streams = (init && init.streams) || [];
let sender = pc._win.RTCRtpSender._create(
pc._win, new RTCRtpSender(pc, transceiverImpl, this, sendTrack, streams));
pc._win, new RTCRtpSender(pc, transceiverImpl, this, sendTrack, kind, streams));

let direction = (init && init.direction) || "sendrecv";
Object.assign(this,
Expand Down
2 changes: 2 additions & 0 deletions media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ TransceiverImpl::InsertDTMFTone(int tone, uint32_t duration)
return;
}

MOZ_ASSERT(mConduit->type() == MediaSessionConduit::AUDIO);

RefPtr<AudioSessionConduit> conduit(static_cast<AudioSessionConduit*>(
mConduit.get()));
mStsThread->Dispatch(WrapRunnableNM([conduit, tone, duration] () {
Expand Down

0 comments on commit 30d5029

Please sign in to comment.