Skip to content

Commit

Permalink
wasm: add PC-handle to label for audio streams, to avoid removing a u…
Browse files Browse the repository at this point in the history
…sed stream when re-negotiating for CBR (#26)
  • Loading branch information
z-dule authored Sep 9, 2021
1 parent dba969e commit f93f434
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wasm/src/avs_pc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ function pc_Create(hnd: number, privacy: number, conv_type: number) {
pc_log(LOG_LEVEL_INFO, `onTrack: calling ash(${pc.convid}, ${label}) with ${event.streams.length} streams`);
audioStreamHandler(
pc.convid,
label,
hnd.toString() + label,
event.streams);
}
if (event.track.kind == "video" && videoStreamHandler) {
Expand Down Expand Up @@ -1387,7 +1387,7 @@ function pc_Close(hnd: number) {
const label = track.label;
if (audioStreamHandler && pc.rtc) {
pc_log(LOG_LEVEL_INFO, `pc_Close: calling ash(${pc.convid}, ${label}) with 0 streams`);
audioStreamHandler(pc.convid, label, null);
audioStreamHandler(pc.convid, hnd.toString() + label, null);
}
}
});
Expand Down Expand Up @@ -1832,7 +1832,7 @@ function pc_RemoveUserInfo(hnd: number, labelPtr: number) {
if (pc.users.hasOwnProperty(label)) {
if (audioStreamHandler) {
pc_log(LOG_LEVEL_INFO, `pcRemoveUserInfo: calling ash(${pc.convid}, ${label}) with 0 streams`);
audioStreamHandler(pc.convid, label, null);
audioStreamHandler(pc.convid, hnd.toString() + label, null);
}
delete pc.users[label];
}
Expand Down

0 comments on commit f93f434

Please sign in to comment.