MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / processChunk

Function processChunk

Source/Resource/JavaScript/Post.js:18–42  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

16 };
17
18 var processChunk = function(e) {
19 if (e.target.error === null) {
20 var state = _this.Open_Buffer_Continue(e.target.result);
21
22 //Test if there is a MediaInfo request to go elsewhere
23 var seekTo = _this.Open_Buffer_Continue_Goto_Get();
24 if(seekTo === -1) {
25 offset += e.target.result.byteLength;
26 } else {
27 offset = seekTo;
28 _this.Open_Buffer_Init(file.size, seekTo); // Inform MediaInfo we have seek
29 }
30 } else {
31 typeof callback==="function"&&callback(); // Error
32 return;
33 }
34
35 // Bit 3 set means finalized
36 if (state&0x08 || e.target.result.byteLength < 1) {
37 _this.Open_Buffer_Finalize();
38 typeof callback==="function"&&callback();
39 return;
40 }
41 loop(CHUNK_SIZE);
42 };
43
44 // Start
45 loop(CHUNK_SIZE);

Callers

nothing calls this directly

Calls 5

loopFunction · 0.85
Open_Buffer_ContinueMethod · 0.65
Open_Buffer_InitMethod · 0.65
Open_Buffer_FinalizeMethod · 0.65

Tested by

no test coverage detected