diff --git a/.changeset/tricky-grapes-cheer.md b/.changeset/tricky-grapes-cheer.md new file mode 100644 index 0000000000..fc8ad6ce8a --- /dev/null +++ b/.changeset/tricky-grapes-cheer.md @@ -0,0 +1,5 @@ +--- +'livekit-client': patch +--- + +Round start bitrate for svc diff --git a/src/room/PCTransport.ts b/src/room/PCTransport.ts index e6fb95ad95..4e6be9aecb 100644 --- a/src/room/PCTransport.ts +++ b/src/room/PCTransport.ts @@ -256,7 +256,9 @@ export default class PCTransport extends EventEmitter { for (const fmtp of media.fmtp) { if (fmtp.payload === codecPayload) { if (!fmtp.config.includes('x-google-start-bitrate')) { - fmtp.config += `;x-google-start-bitrate=${trackbr.maxbr * startBitrateForSVC}`; + fmtp.config += `;x-google-start-bitrate=${Math.round( + trackbr.maxbr * startBitrateForSVC, + )}`; } if (!fmtp.config.includes('x-google-max-bitrate')) { fmtp.config += `;x-google-max-bitrate=${trackbr.maxbr}`; @@ -269,9 +271,9 @@ export default class PCTransport extends EventEmitter { if (!fmtpFound) { media.fmtp.push({ payload: codecPayload, - config: `x-google-start-bitrate=${ - trackbr.maxbr * startBitrateForSVC - };x-google-max-bitrate=${trackbr.maxbr}`, + config: `x-google-start-bitrate=${Math.round( + trackbr.maxbr * startBitrateForSVC, + )};x-google-max-bitrate=${trackbr.maxbr}`, }); }