Skip to content

Commit ba705c6

Browse files
authored
Merge pull request #46 from rationalsa/0rtt
SLS: parse 0 RTT correctly
2 parents f3c7672 + 08e171c commit ba705c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/components/ObsSwitcher.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,15 @@ class ObsSwitcher extends _events.default {
209209

210210
case "srt-live-server":
211211
try {
212+
var _stream$rtt;
213+
212214
var _srtresponse = yield (0, _nodeFetch.default)(stats);
213215

214216
var _srtdata = yield _srtresponse.json();
215217

216218
var stream = _srtdata.publishers[publisher];
217219
_this2.bitrate = (stream === null || stream === void 0 ? void 0 : stream.bitrate) || null;
218-
_this2.rtt = (stream === null || stream === void 0 ? void 0 : stream.rtt) || null;
220+
_this2.rtt = (_stream$rtt = stream === null || stream === void 0 ? void 0 : stream.rtt) !== null && _stream$rtt !== void 0 ? _stream$rtt : null;
219221
} catch (e) {
220222
log.error("[SLS] Error fetching stats: " + e);
221223
}

src/components/ObsSwitcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class ObsSwitcher extends EventEmitter {
284284
const stream = srtdata.publishers[publisher];
285285

286286
this.bitrate = stream?.bitrate || null;
287-
this.rtt = stream?.rtt || null;
287+
this.rtt = stream?.rtt ?? null;
288288
} catch (e) {
289289
log.error("[SLS] Error fetching stats: " + e);
290290
}

0 commit comments

Comments
 (0)