test pc před 3 roky
rodič
revize
e2598677bf
1 změnil soubory, kde provedl 13 přidání a 10 odebrání
  1. 13 10
      src/v2Decoder/index.js

+ 13 - 10
src/v2Decoder/index.js

@@ -418,16 +418,19 @@ if ("function" === typeof importScripts) {
 
   Decoder.prototype.procBufItem = function (index) {
     this.dumpJitterBufInfo("Entering Decoder.prototype.procBufItem");
-    self.postMessage({
-      t: 11,
-      pts: mediaArray[index].pts,
-      isIDR: mediaArray[index].isIDR,
-      mediaLength: mediaArray[index].media.length,
-      traceIds:mediaArray[index].metadata.traceIds,
-      cameraPosition:JSON.stringify(mediaArray[index].metadata.newUserStates[0].playerState.camera.position),
-      isMoving:mediaArray[index].metadata.newUserStates[0].renderInfo.isMoving,
-      time:new Date().getTime()
-    })
+    if(mediaArray[index].media && mediaArray[index].media.length>0){
+      self.postMessage({
+        t: 11,
+        pts: mediaArray[index].pts,
+        isIDR: mediaArray[index].isIDR,
+        mediaLength: mediaArray[index].media.length,
+        traceIds:mediaArray[index].metadata.traceIds,
+        cameraPosition:JSON.stringify(mediaArray[index].metadata.newUserStates[0].playerState.camera.position),
+        isMoving:mediaArray[index].metadata.newUserStates[0].renderInfo.isMoving,
+        time:new Date().getTime()
+      })
+    }
+
     // console.log("[][Core][WASM], pts: %s, isIDR: %s, length: %s",
     //   mediaArray[index].pts,
     //   mediaArray[index].isIDR,