Skip to content

Commit

Permalink
Round start bitrate for svc (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnderrauber authored Nov 2, 2023
1 parent b6e1f1a commit 525d90c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-grapes-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Round start bitrate for svc
10 changes: 6 additions & 4 deletions src/room/PCTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -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}`,
});
}

Expand Down

0 comments on commit 525d90c

Please sign in to comment.