浏览代码

procBufItem add try cache

gemercheung 3 年之前
父节点
当前提交
e1d526f162
共有 3 个文件被更改,包括 15 次插入9 次删除
  1. 1 1
      src/Workers.js
  2. 1 0
      src/main.js
  3. 13 8
      src/v2Decoder/index.js

+ 1 - 1
src/Workers.js

@@ -1068,7 +1068,7 @@ export default class Workers {
         at: at,
       });
     }
-    console.log("metaverse----IDR:"+copyIDR);
+    // console.log("metaverse----IDR:"+copyIDR);
 
     // debugger;
     const down = Date.now();

+ 1 - 0
src/main.js

@@ -38,6 +38,7 @@ const l = async()=>{
             // wsServerUrl: "ws://localhost:6688/ws",
             wsServerUrl: "wss://meta-socket.4dage.com/ws",
             appId: "10016",
+            // appId: "0000000002",
             token: " ",
             nickname: nickname,
             firends: ["user1"],

+ 13 - 8
src/v2Decoder/index.js

@@ -575,8 +575,13 @@ if ("function" === typeof importScripts) {
       }
       return false;
     }
+    try {
+      this.procBufItem(this.readPtr);
+    } catch (error) {
+      
+    }
+
 
-    this.procBufItem(this.readPtr);
 
     // if (this.getNumOfPktToBeDec() > this.prevBufNum) {
     //   this.cntBufInc++
@@ -745,7 +750,7 @@ if ("function" === typeof importScripts) {
     printConsole.log("Going to open decoder " + String(Date.now()));
     var ret0 = Module._openDecoder(0, decoder_type, LOG_LEVEL_WASM);
     if (ret0 == 0) {
-      self.decoder.startDecoding();                                                                     //开始解码
+      self.decoder.startDecoding();                                                                     //锟斤拷始锟斤拷锟斤拷
       self.postMessage({
         t: MessageEvent.WASMReady,
         wasm_ready: true,
@@ -794,10 +799,10 @@ if ("function" === typeof importScripts) {
     // return data.isIDR && media.byteLength !=0
     let flag =  isIDR && mediaLen != 0;
     if(flag){
-      console.log('metaverse---------IFrame');
+      console.log('metaverse---------锟斤拷IFrame');
     }
     else{
-      console.log('metaverse---------不是IFrame');
+      console.log('metaverse---------锟斤拷锟斤拷IFrame');
     }
     return flag;
   };
@@ -806,10 +811,10 @@ if ("function" === typeof importScripts) {
     // return !data.isIDR && media.byteLength !=0
     let flag = !isIDR && mediaLen != 0;
     if(flag){
-      console.log('metaverse---------PFrame');
+      console.log('metaverse---------锟斤拷PFrame');
     }
     else{
-      console.log('metaverse---------不是PFrame');
+      console.log('metaverse---------锟斤拷锟斤拷PFrame');
     }
     return flag;
   };
@@ -818,10 +823,10 @@ if ("function" === typeof importScripts) {
     // return media.byteLength == 0 && meta.byteLength !=0
     let flag = mediaLen == 0 && metaLen != 0;
     if(flag){
-      console.log('metaverse---------PureMeta');
+      console.log('metaverse---------锟斤拷PureMeta');
     }
     else{
-      console.log('metaverse---------不是PureMeta');
+      console.log('metaverse---------锟斤拷锟斤拷PureMeta');
     }
     return flag;
   };