Commit 69150b38 authored by NzSN's avatar NzSN

Flush encoder in EOFProcessing

parent ae3cc906
......@@ -161,17 +161,14 @@ async function steps() {
async function EOFProcessing() {
let ret = 0, size_;
console.log(ident + " EOF");
encoder._flushEncoder();
while (true) {
ret = encoder._getPackets(encBuf, ENC_BUF_SIZE, size);
size_ = encoder.getValue(size, 'i32');
if (ret == 1) {
/* No more frames here */
if (size_ == 0) {
break;
} else if (ret > 0) {
throw new Error("Encoder internal error")
}
sendToMuxerUntilSuccess(size_, 500);
......@@ -214,6 +211,7 @@ async function RGBProcessing(frame) {
// Unit of interval is millionsecond
async function sendToMuxerUntilSuccess(size, interval) {
console.log("Send to Muxer");
while (!sendToMuxer(size)) {
await sleep(interval);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment