security-union / videocall-rs

teleconference system written in rust
MIT License
1.34k stars 114 forks source link

audio decoding error #139

Closed dsaetgareev closed 10 months ago

dsaetgareev commented 10 months ago

https://github.com/security-union/videocall-rs/blob/76c8d736e3349270950e7b2e439ccc643400da8a/yew-ui/src/model/decode/peer_decode_manager.rs#L107

Hello. I use part of the project code in my project, the code responsible for transferring the video and audio stream, I transfer chunks via webtrc. The video works without errors, while decoding the audio I get the error "Uncaught Error: closure invoked recursively or after being dropped". I've been struggling with this problem for three days now. Maybe you also faced this problem? Screenshot from 2023-08-31 21-02-41 Screenshot from 2023-08-31 21-04-38 Screenshot from 2023-08-31 22-00-25

darioalessandro commented 10 months ago

Hey @dsaetgareev indeed I have seen this!!

this is likely because the error and output callbacks are being deallocated by rust but then javascript is trying to call them, to solve this simply call:

forget(error)
forget(output)

or store those callbacks such that they do not get dropped

dsaetgareev commented 10 months ago

Dario, hello!!! I just saw your message and immediately followed your advice, and everything worked!!! Added error.forget(); output.forget(); Dario, thank you very much for your help!! image

darioalessandro commented 10 months ago

that is awesome !!! 😄 glad I was able to help!