koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
3.9k stars 237 forks source link

webrtc: don't store audio codec before intercom start #1462

Closed xdissent closed 1 month ago

xdissent commented 1 month ago

The audio transceiver sender can set its codec after the initial setup, but a null value was being stored if it wasn't immediately available. This PR simply checks the codec whenever the intercom starts rather than using the cached value.

This (along with #1461) totally fixes my ring pro doorbell two-way audio. It makes sense because when I would force the ring plugin to use the "browser" webrtc endpoint, it immediately turned on 2-way and set up the codec, making the cached value correct. But the web socket ring webrtc endpoint delays 2-way setup, so the initial audio codec is null, and wrtc-to-rtsp would error when starting the intercom even though the codec was set up correctly at that point.