mirror of
https://github.com/koush/scrypted.git
synced 2026-08-11 23:50:47 +01:00
onvif: fix backchannel clock and aggregation. fixes https://github.com/koush/scrypted/issues/2118
This commit is contained in:
@@ -150,8 +150,10 @@ export class OnvifIntercom implements Intercom {
|
||||
return;
|
||||
}
|
||||
|
||||
const elapsedRtpTimeMs = Math.abs(pending.header.timestamp - p.header.timestamp) / 8000 * 1000;
|
||||
if (elapsedRtpTimeMs <= 160 && pending.payload.length + p.payload.length <= 1024) {
|
||||
const clock = defaultMatch.clock || 8000;
|
||||
const canAggregate = defaultMatch.ffmpegEncoder === 'pcm_mulaw' || defaultMatch.ffmpegEncoder === 'pcm_alaw';
|
||||
const elapsedRtpTimeMs = Math.abs(pending.header.timestamp - p.header.timestamp) / clock * 1000;
|
||||
if (canAggregate && elapsedRtpTimeMs <= 160 && pending.payload.length + p.payload.length <= 1024) {
|
||||
pending.payload = Buffer.concat([pending.payload, p.payload]);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user