|
@@ -2157,9 +2157,9 @@ 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;
|
|
2160
|
+ const { audioQuality } = this.options;
|
2161
|
2161
|
|
2162
|
|
- if (!opusMaxAverageBitrate || !stereo) {
|
|
2162
|
+ if (!audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
|
2163
|
2163
|
return description;
|
2164
|
2164
|
}
|
2165
|
2165
|
|
|
@@ -2171,7 +2171,8 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
|
2171
|
2171
|
const { payload } = mLine.rtp.find(protocol => protocol.codec === CodecMimeType.OPUS);
|
2172
|
2172
|
|
2173
|
2173
|
if (!payload) {
|
2174
|
|
- break;
|
|
2174
|
+ // eslint-disable-next-line no-continue
|
|
2175
|
+ continue;
|
2175
|
2176
|
}
|
2176
|
2177
|
|
2177
|
2178
|
let fmtpOpus = mLine.fmtp.find(protocol => protocol.payload === payload);
|
|
@@ -2186,18 +2187,19 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
|
2186
|
2187
|
const fmtpConfig = transform.parseParams(fmtpOpus.config);
|
2187
|
2188
|
let sdpChanged = false;
|
2188
|
2189
|
|
2189
|
|
- if (stereo) {
|
|
2190
|
+ if (audioQuality?.stereo) {
|
2190
|
2191
|
fmtpConfig.stereo = 1;
|
2191
|
2192
|
sdpChanged = true;
|
2192
|
2193
|
}
|
2193
|
2194
|
|
2194
|
|
- if (opusMaxAverageBitrate) {
|
2195
|
|
- fmtpConfig.opusMaxAverageBitrate = opusMaxAverageBitrate;
|
|
2195
|
+ if (audioQuality?.opusMaxAverageBitrate) {
|
|
2196
|
+ fmtpConfig.opusMaxAverageBitrate = audioQuality.opusMaxAverageBitrate;
|
2196
|
2197
|
sdpChanged = true;
|
2197
|
2198
|
}
|
2198
|
2199
|
|
2199
|
2200
|
if (!sdpChanged) {
|
2200
|
|
- break;
|
|
2201
|
+ // eslint-disable-next-line no-continue
|
|
2202
|
+ continue;
|
2201
|
2203
|
}
|
2202
|
2204
|
|
2203
|
2205
|
let mungedConfig = '';
|