jbc-dssi 1.1.151 → 1.1.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/ogg-opus.js +15 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3148,7 +3148,7 @@ class BridgeConnection {
|
|
|
3148
3148
|
? Number(frame.cursor)
|
|
3149
3149
|
: 0;
|
|
3150
3150
|
// 裁剪:实测一个 80 条消息的快照原样是 1278 KB,裁完降到几十 KB
|
|
3151
|
-
this.send(FRAME.SNAPSHOT,
|
|
3151
|
+
this.send(FRAME.SNAPSHOT, frame);
|
|
3152
3152
|
// 附着后的首个快照里已带最新投影:顺手刷新一次团队快照
|
|
3153
3153
|
this.#scheduleBotsRefresh(60);
|
|
3154
3154
|
break;
|
package/lib/ogg-opus.js
CHANGED
|
@@ -108,15 +108,27 @@ export function createOggOpusStream() {
|
|
|
108
108
|
return drain();
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
let pending = null;
|
|
112
|
+
|
|
111
113
|
function packet(data) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
const out = pending
|
|
115
|
+
? [page({ headerType: 0x00, granule, serial, sequence: sequence++, packets: [pending] })]
|
|
116
|
+
: [];
|
|
117
|
+
const samples = packetSamples(data);
|
|
118
|
+
granule += samples;
|
|
119
|
+
pending = data;
|
|
120
|
+
pages.push(...out);
|
|
114
121
|
return drain();
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
function end() {
|
|
118
125
|
const out = [];
|
|
119
|
-
|
|
126
|
+
if (pending) {
|
|
127
|
+
out.push(page({ headerType: 0x04, granule, serial, sequence: sequence++, packets: [pending] }));
|
|
128
|
+
pending = null;
|
|
129
|
+
} else {
|
|
130
|
+
out.push(page({ headerType: 0x04, granule, serial, sequence: sequence++, packets: [] }));
|
|
131
|
+
}
|
|
120
132
|
pages.push(...out);
|
|
121
133
|
return drain();
|
|
122
134
|
}
|