From cd9c5afe1525476d93bde4e8f9985a3e1c6579d0 Mon Sep 17 00:00:00 2001 From: Jeff Wang Date: Thu, 15 Jun 2017 15:17:22 +1000 Subject: [PATCH] just in case that both functions are valid. I found this when I try to add h264 support in our repo. --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6312e64..2acc27d 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,11 @@ module.exports = function(pc, opts) { var defaultFail = tq.bind(tq, 'fail'); // look for an sdpfilter function (allow slight mis-spellings) - var sdpFilter = (opts || {}).sdpfilter || (opts || {}).sdpFilter; + var sdpFilter = null; + if ((opts || {}).sdpfilter && (opts || {}).sdpFilter) { + sdpFilter = function(sdp) {return (opts || {}).sdpfilter((opts || {}).sdpFilter(sdp));} + } else + sdpFilter = (opts || {}).sdpfilter || (opts || {}).sdpFilter; var alwaysParse = (opts.sdpParseMode === 'always'); // initialise session description and icecandidate objects