@basmilius/apple-raop 0.9.17 → 0.9.19

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.
Files changed (2) hide show
  1. package/dist/index.mjs +3 -9
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -126,7 +126,6 @@ var ControlClient = class extends EventEmitter {
126
126
  #context;
127
127
  #packetBacklog;
128
128
  #syncTask;
129
- #abortController;
130
129
  #localPort;
131
130
  constructor(context, packetBacklog) {
132
131
  super();
@@ -162,14 +161,9 @@ var ControlClient = class extends EventEmitter {
162
161
  }
163
162
  start(remoteAddr) {
164
163
  if (this.#syncTask) throw new Error("Already running");
165
- this.#abortController = new AbortController();
166
164
  this.#startSyncTask(remoteAddr, this.#context.controlPort);
167
165
  }
168
166
  stop() {
169
- if (this.#abortController) {
170
- this.#abortController.abort();
171
- this.#abortController = void 0;
172
- }
173
167
  if (this.#syncTask) {
174
168
  clearInterval(this.#syncTask);
175
169
  this.#syncTask = void 0;
@@ -194,9 +188,10 @@ var ControlClient = class extends EventEmitter {
194
188
  }
195
189
  #retransmitLostPackets(request, addr) {
196
190
  for (let i = 0; i < request.lostPackets; i++) {
197
- const seqno = request.lostSeqno + i;
191
+ const seqno = request.lostSeqno + i & 65535;
198
192
  if (this.#packetBacklog.has(seqno)) {
199
193
  const packet = this.#packetBacklog.get(seqno);
194
+ if (packet.byteLength < 4) continue;
200
195
  const originalSeqno = packet.subarray(2, 4);
201
196
  const resp = Buffer.concat([
202
197
  Buffer.from([128, 214]),
@@ -523,7 +518,6 @@ var StreamClient = class extends EventEmitter {
523
518
  this.#timingServer = timingServer;
524
519
  }
525
520
  close() {
526
- this.#protocol.teardown();
527
521
  this.#controlClient?.close();
528
522
  }
529
523
  async initialize(properties) {
@@ -592,7 +586,7 @@ var StreamClient = class extends EventEmitter {
592
586
  await this.#streamData(source, transport);
593
587
  } catch (err) {
594
588
  this.#context.logger.error("An error occurred during streaming.", err);
595
- throw new Error(`An error occurred during streaming: ${err}`);
589
+ throw new Error("An error occurred during streaming.", { cause: err });
596
590
  } finally {
597
591
  this.#packetBacklog.clear();
598
592
  if (transport) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@basmilius/apple-raop",
3
3
  "description": "Implementation of Apple's RAOP protocol in Node.js.",
4
- "version": "0.9.17",
4
+ "version": "0.9.19",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -46,10 +46,10 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@basmilius/apple-common": "0.9.17",
50
- "@basmilius/apple-encoding": "0.9.17",
51
- "@basmilius/apple-encryption": "0.9.17",
52
- "@basmilius/apple-rtsp": "0.9.17"
49
+ "@basmilius/apple-common": "0.9.19",
50
+ "@basmilius/apple-encoding": "0.9.19",
51
+ "@basmilius/apple-encryption": "0.9.19",
52
+ "@basmilius/apple-rtsp": "0.9.19"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/bun": "^1.3.11",