elixir-webrtc / ex_webrtc

An Elixir implementation of the W3C WebRTC API
Apache License 2.0
269 stars 8 forks source link

Fix `TWCCRecorder` base timestamp evaluation bug #86

Closed LVala closed 3 months ago

LVala commented 3 months ago

The TWCCRecorder module has a default argument that keeps the initial value of System.monotonic_time() (so the subsequent calls could be offset to be positive, as output of System.monotonic_time() is usually negative). The value is evaluated at the compile time and differs from the runtime base System.monotonic_time() value, which is obviously undesired. This PR fixes this issue.

clone1018 commented 3 months ago

I suspect I experienced this locally during multiple subsequent runs of mix test!

LVala commented 3 months ago

@clone1018 most likely, I didn't recompile the module for some time (I guess the baked-in base timestamp value was somehow valid?). I noticed the issue when updating the Elixir version.