Sfoglia il codice sorgente

e2ee: drop video on decode errors (#1114)

Reverts #1098, that strategy does not work. When switching from garbage to non-garbage the decoder
would decode subsequent packets based on the wrong keyframe.
dev1
Philipp Hancke 5 anni fa
parent
commit
cc1114434c
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 7 aggiunte e 14 eliminazioni
  1. 7
    14
      modules/e2ee/E2EEContext.js

+ 7
- 14
modules/e2ee/E2EEContext.js Vedi File

326
                 return controller.enqueue(encodedFrame);
326
                 return controller.enqueue(encodedFrame);
327
             }, e => {
327
             }, e => {
328
                 logger.error(e, encodedFrame.type);
328
                 logger.error(e, encodedFrame.type);
329
+
330
+                // TODO: notify the application about error status.
331
+
332
+                // TODO: For video we need a better strategy since we do not want to based any
333
+                // non-error frames on a garbage keyframe.
329
                 if (encodedFrame.type === undefined) { // audio, replace with silence.
334
                 if (encodedFrame.type === undefined) { // audio, replace with silence.
335
+                    // audio, replace with silence.
330
                     const newData = new ArrayBuffer(3);
336
                     const newData = new ArrayBuffer(3);
331
                     const newUint8 = new Uint8Array(newData);
337
                     const newUint8 = new Uint8Array(newData);
332
 
338
 
333
                     newUint8.set([ 0xd8, 0xff, 0xfe ]); // opus silence frame.
339
                     newUint8.set([ 0xd8, 0xff, 0xfe ]); // opus silence frame.
334
                     encodedFrame.data = newData;
340
                     encodedFrame.data = newData;
335
-                } else { // video, replace with a 320x180px black frame
336
-                    const newData = new ArrayBuffer(60);
337
-                    const newUint8 = new Uint8Array(newData);
338
-
339
-                    newUint8.set([
340
-                        0xb0, 0x05, 0x00, 0x9d, 0x01, 0x2a, 0xa0, 0x00, 0x5a, 0x00, 0x39, 0x03, 0x00, 0x00, 0x1c, 0x22,
341
-                        0x16, 0x16, 0x22, 0x66, 0x12, 0x20, 0x04, 0x90, 0x40, 0x00, 0xc5, 0x01, 0xe0, 0x7c, 0x4d, 0x2f,
342
-                        0xfa, 0xdd, 0x4d, 0xa5, 0x7f, 0x89, 0xa5, 0xff, 0x5b, 0xa9, 0xb4, 0xaf, 0xf1, 0x34, 0xbf, 0xeb,
343
-                        0x75, 0x36, 0x95, 0xfe, 0x26, 0x96, 0x60, 0xfe, 0xff, 0xba, 0xff, 0x40
344
-                    ]);
345
-                    encodedFrame.data = newData;
341
+                    controller.enqueue(encodedFrame);
346
                 }
342
                 }
347
-
348
-                // TODO: notify the application about error status.
349
-                controller.enqueue(encodedFrame);
350
             });
343
             });
351
         }
344
         }
352
 
345
 

Loading…
Annulla
Salva