File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ export default {
2121 cleanup ( ) {
2222 if ( this . worker ) {
2323 this . worker . terminate ( ) ;
24- this . worker = null ;
2524 }
2625
2726 // unsub trame.rca.topic.stream
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ onmessage = async function({ data: msg }) {
7070 this.decoder.reset();
7171 break;
7272 case 6: // close
73+ // flush before close() to avoid currepoted state.
74+ // calling postMessage(flush)
75+ // postMessage(close) is not enough since the second
76+ // abort the first before it finishes.
77+ await this.decoder.flush();
7378 this.decoder.close();
7479 break;
7580 }
@@ -134,7 +139,9 @@ export class DecoderWorker {
134139
135140 terminate ( ) {
136141 this . worker . postMessage ( { action : CLOSE } ) ;
137- this . worker . terminate ( ) ;
138- this . worker = null ;
142+ // don't terminate immediately we need to wail for the video encoder to finish flushing
143+ // not sure how to achieve this ...
144+ //this.worker.terminate();
145+ //this.worker = null;
139146 }
140147}
You can’t perform that action at this time.
0 commit comments