Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remotion/streaming

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remotion/streaming - npm Package Compare versions

Comparing version 4.0.183 to 4.0.184

54

dist/make-streamer.js

@@ -6,3 +6,2 @@ "use strict";

exports.streamingKey = 'remotion_buffer:';
const magicWordStr = 'remotion_buffer:';
// @ts-expect-error

@@ -13,5 +12,5 @@ globalThis._dumpUnreleasedBuffers = new stream_1.EventEmitter();

const makeStreamer = (onMessage) => {
const separator = new Uint8Array(magicWordStr.length);
for (let i = 0; i < magicWordStr.length; i++) {
separator[i] = magicWordStr.charCodeAt(i);
const separator = new Uint8Array(exports.streamingKey.length);
for (let i = 0; i < exports.streamingKey.length; i++) {
separator[i] = exports.streamingKey.charCodeAt(i);
}

@@ -21,8 +20,22 @@ let unprocessedBuffers = [];

let missingData = null;
const processInput = () => {
let separatorIndex = outputBuffer.indexOf(separator[0]); // Start checking for the first byte of the separator
if (separatorIndex === -1 ||
outputBuffer
const findSeparatorIndex = () => {
let searchIndex = 0;
// eslint-disable-next-line no-constant-condition
while (true) {
const separatorIndex = outputBuffer.indexOf(separator[0], searchIndex); // Start checking for the first byte of the separator
if (separatorIndex === -1) {
return -1;
}
if (outputBuffer
.subarray(separatorIndex, separatorIndex + separator.length)
.toString() !== separator.toString()) {
searchIndex = separatorIndex + 1;
continue;
}
return separatorIndex;
}
};
const processInput = () => {
let separatorIndex = findSeparatorIndex(); // Start checking for the first byte of the separator
if (separatorIndex === -1) {
return;

@@ -92,18 +105,17 @@ }

unprocessedBuffers.push(data);
const separatorIndex = data.indexOf(separator[0]);
if (separatorIndex === -1) {
if (missingData) {
missingData.dataMissing -= data.length;
}
if (!missingData || missingData.dataMissing > 0) {
return;
}
if (missingData) {
missingData.dataMissing -= data.length;
}
unprocessedBuffers.unshift(outputBuffer);
outputBuffer = new Uint8Array(unprocessedBuffers.reduce((acc, val) => acc + val.length, 0));
let offset = 0;
if (missingData && missingData.dataMissing > 0) {
return;
}
const newBuffer = new Uint8Array(outputBuffer.length +
unprocessedBuffers.reduce((acc, val) => acc + val.length, 0));
newBuffer.set(outputBuffer, 0);
let offset = outputBuffer.length;
for (const buf of unprocessedBuffers) {
outputBuffer.set(buf, offset);
newBuffer.set(buf, offset);
offset += buf.length;
}
outputBuffer = newBuffer;
unprocessedBuffers = [];

@@ -126,3 +138,3 @@ processInput();

const nonceArr = new TextEncoder().encode(nonce);
const magicWordArr = new TextEncoder().encode(magicWordStr);
const magicWordArr = new TextEncoder().encode(exports.streamingKey);
const separatorArr = new TextEncoder().encode(':');

@@ -129,0 +141,0 @@ const bodyLengthArr = new TextEncoder().encode(body.length.toString());

@@ -6,3 +6,3 @@ {

"name": "@remotion/streaming",
"version": "4.0.183",
"version": "4.0.184",
"description": "Utilities for streaming data between programs",

@@ -9,0 +9,0 @@ "main": "dist",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc