gemercheung 3 年之前
父節點
當前提交
67b6a4235f
共有 1 個文件被更改,包括 10 次插入5 次删除
  1. 10 5
      src/scene/scene.service.ts

+ 10 - 5
src/scene/scene.service.ts

@@ -582,7 +582,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       this.moveService.sendingFrameForJoystick = true;
 
       // if (this.joystickFrameCnt === -1) {
-        this.joystickFrameCnt = this.frameCnt.getValue();
+      this.joystickFrameCnt = this.frameCnt.getValue();
       // }
       this.joystickFrameCnt += 1;
       const streamData: StreamFrameType = {
@@ -621,7 +621,12 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           ) as StreamReplyType;
           console.log('has-complementFrame', complementFrame);
           if (complementFrame) {
-            pushJoyStickSteam(complementFrame);
+            const start = performance.now();
+            pushJoyStickSteam(complementFrame, true);
+            const stop = performance.now();
+            const inMillSeconds = stop - start;
+            const rounded = Number(inMillSeconds).toFixed(3);
+            console.log(`complementFrame调用时间---->${rounded}`);
           } else {
             this.logger.log('joystick opt done');
             this.logger.log('joystick 交权给空流,当前pts', hasPush.frame);
@@ -685,9 +690,9 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           if (!this.onMoving.getValue()) {
             // 在非行走时接受
             this.holdSteam();
-            if (this.joystickFrameCnt === -1) {
-              this.joystickFrameCnt = this.frameCnt.getValue();
-            }
+            // if (this.joystickFrameCnt === -1) {
+            this.joystickFrameCnt = this.frameCnt.getValue();
+            // }
             // 人物数据去掉mediaSrc以免前误会
             joystickRes?.mediaSrc && delete joystickRes.mediaSrc;