|
@@ -2157,6 +2157,12 @@ TraceablePeerConnection.prototype._adjustLocalMediaDirection = function(
|
2157
|
2157
|
* @returns {RTCSessionDescription} the munged description.
|
2158
|
2158
|
*/
|
2159
|
2159
|
TraceablePeerConnection.prototype._mungeOpus = function(description) {
|
|
2160
|
+ const { opusMaxAverageBitrate, stereo } = this.options;
|
|
2161
|
+
|
|
2162
|
+ if (!opusMaxAverageBitrate || !stereo) {
|
|
2163
|
+ return description;
|
|
2164
|
+ }
|
|
2165
|
+
|
2160
|
2166
|
const parsedSdp = transform.parse(description.sdp);
|
2161
|
2167
|
const mLines = parsedSdp.media;
|
2162
|
2168
|
|
|
@@ -2180,13 +2186,13 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
|
2180
|
2186
|
const fmtpConfig = transform.parseParams(fmtpOpus.config);
|
2181
|
2187
|
let sdpChanged = false;
|
2182
|
2188
|
|
2183
|
|
- if (this.options.stereo) {
|
|
2189
|
+ if (stereo) {
|
2184
|
2190
|
fmtpConfig.stereo = 1;
|
2185
|
2191
|
sdpChanged = true;
|
2186
|
2192
|
}
|
2187
|
2193
|
|
2188
|
|
- if (this.options.opusMaxAverageBitrate) {
|
2189
|
|
- fmtpConfig.opusMaxAverageBitrate = this.options.opusMaxAverageBitrate;
|
|
2194
|
+ if (opusMaxAverageBitrate) {
|
|
2195
|
+ fmtpConfig.opusMaxAverageBitrate = opusMaxAverageBitrate;
|
2190
|
2196
|
sdpChanged = true;
|
2191
|
2197
|
}
|
2192
|
2198
|
|