Browse Source

Merge branch 'master' of http://face3d.4dage.com:7005/zhangyupeng/meta-server

gemercheung 3 years ago
parent
commit
fb9a8b700f
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/scene/scene.service.ts

+ 7 - 3
src/scene/scene.service.ts

@@ -80,7 +80,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
   private requestIFrameQueueSub: any;
   private roRequestQueueSub: any;
   private rotateTimeStamp: number;
-
+  private rewalking = false
   private firstRender = false;
   private latestBreakPointId: number;
   private isHoldingStream = false;
@@ -423,7 +423,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
             );
             this.logger.log('stop-redisMeta', JSON.stringify(redisMeta));
             // 2. 中断重新walking
-            console.log('walking-step-reWalking-1', request.trace_id);
+            console.log('walking-step-reWalking-1', request.trace_id+','+this.latestWalkingRequest.trace_id);
             this.handleReWalking(this.latestWalkingRequest);
           }
         },
@@ -462,7 +462,9 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
 
       //this.logger.log('walking', walkingRes);
       // debugger;
-      if (walkingRes && !this.onMoving.value) {
+      // console.log('walking:'+JSON.stringify(walkingRes))
+      // console.log('this.onMoving.value:'+this.onMoving.value)
+      if (walkingRes && (!this.onMoving.value || this.rewalking)) {
         //this.logger.log('walkingRes-front', walkingRes);
         // shift出前第一个镜头数据
         const rotateCamData = walkingRes[0];
@@ -537,6 +539,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
    */
   handleReWalking(request: MoveRequest) {
     this.latestWalkingRequest = null;
+    this.rewalking = true
     this.handleWalking(request);
   }
 
@@ -767,6 +770,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           clearTimeout(this._moveTimeout);
           this._moveTimeout = setTimeout(() => {
             this.logger.log('move 交权给空流,当前pts', res.frame);
+            this.rewalking = false;
             this.frameCnt.next(res.frame);
             this.resumeStream();
             this.rotateframeCnt = -1;