MCPcopy Create free account
hub / github.com/modelscope/FunASR / readMatroskaVInt

Function readMatroskaVInt

runtime/html5/static/recorder-core.js:1429–1441  ·  view source on GitHub ↗
(arr,pos,trim)

Source from the content-addressed store, hash-verified

1427};
1428//读取一个可变长数值字节数组
1429var readMatroskaVInt=function(arr,pos,trim){
1430 var i=pos[0];
1431 if(i>=arr.length)return;
1432 var b0=arr[i],b2=("0000000"+b0.toString(2)).substr(-8);
1433 var m=/^(0*1)(\d*)$/.exec(b2);
1434 if(!m)return;
1435 var len=m[1].length, val=[];
1436 if(i+len>arr.length)return;
1437 for(var i2=0;i2<len;i2++){ val[i2]=arr[i]; i++; }
1438 if(trim) val[0]=parseInt(m[2]||'0',2);
1439 pos[0]=i;
1440 return val;
1441};
1442//读取一个自带长度的内容字节数组
1443var readMatroskaBlock=function(arr,pos){
1444 var lenVal=readMatroskaVInt(arr,pos,1);

Callers 2

WebM_ExtractFunction · 0.70
readMatroskaBlockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…