lox-airplay-sender 0.3.2 → 0.3.3

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.
@@ -47,9 +47,10 @@ class AudioOut extends node_events_1.EventEmitter {
47
47
  packet.timestamp = (0, numUtil_1.low32)(seq * config_1.default.frames_per_packet + 2 * config_1.default.sampling_rate);
48
48
  if (this.hasAirTunes && seq % config_1.default.sync_period === 0) {
49
49
  this.emit('need_sync', seq);
50
+ const nowMs = node_perf_hooks_1.performance.now();
50
51
  const expectedTimeMs = this.rtpTimeRef +
51
52
  ((seq * config_1.default.frames_per_packet) / config_1.default.sampling_rate) * 1000;
52
- const deltaMs = Date.now() - expectedTimeMs;
53
+ const deltaMs = nowMs - expectedTimeMs;
53
54
  this.emit('metrics', { type: 'sync', seq, deltaMs, latencyFrames: this.latencyFrames });
54
55
  }
55
56
  this.emit('packet', packet);
package/dist/core/rtsp.js CHANGED
@@ -1636,7 +1636,8 @@ Client.prototype.processData = function (blob, rawData) {
1636
1636
  ;
1637
1637
  break;
1638
1638
  case SETPROGRESS:
1639
- this.status = this.airplay2 ? FLUSH : PLAYING;
1639
+ // After reporting progress, stay in PLAYING; avoid forcing FLUSH on every update.
1640
+ this.status = PLAYING;
1640
1641
  break;
1641
1642
  case SETDAAP:
1642
1643
  this.status = PLAYING;
@@ -47,9 +47,10 @@ class AudioOut extends node_events_1.EventEmitter {
47
47
  packet.timestamp = (0, numUtil_1.low32)(seq * config_1.default.frames_per_packet + 2 * config_1.default.sampling_rate);
48
48
  if (this.hasAirTunes && seq % config_1.default.sync_period === 0) {
49
49
  this.emit('need_sync', seq);
50
+ const nowMs = node_perf_hooks_1.performance.now();
50
51
  const expectedTimeMs = this.rtpTimeRef +
51
52
  ((seq * config_1.default.frames_per_packet) / config_1.default.sampling_rate) * 1000;
52
- const deltaMs = Date.now() - expectedTimeMs;
53
+ const deltaMs = nowMs - expectedTimeMs;
53
54
  this.emit('metrics', { type: 'sync', seq, deltaMs, latencyFrames: this.latencyFrames });
54
55
  }
55
56
  this.emit('packet', packet);
@@ -1636,7 +1636,8 @@ Client.prototype.processData = function (blob, rawData) {
1636
1636
  ;
1637
1637
  break;
1638
1638
  case SETPROGRESS:
1639
- this.status = this.airplay2 ? FLUSH : PLAYING;
1639
+ // After reporting progress, stay in PLAYING; avoid forcing FLUSH on every update.
1640
+ this.status = PLAYING;
1640
1641
  break;
1641
1642
  case SETDAAP:
1642
1643
  this.status = PLAYING;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lox-airplay-sender",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "AirPlay sender (RAOP/AirPlay 1 + AirPlay 2 auth flows) ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",