KallDrexx / rust-media-libs

Rust based libraries for misc media functionality
Apache License 2.0
229 stars 58 forks source link

Fix extended timestamp on type 3 chunks #23

Closed jamesbirtles closed 3 years ago

jamesbirtles commented 3 years ago

I was getting spammed with messages from gstreamer when pulling from my RTMP server after a period of time, e.g:

Type 3 extended timestamp does not match expected timestamp (want 250836763 got 2960806818)

After some reading of the RTMP spec and understanding the serialization code, I've come to this fix. The comment above it suggests this was probably what was originally intended, as the code currently ends up always being calculated as 0 as far as I can tell.

This is only an issue with longer running streams, and actually gstreamer didn't seem to care all that much other than the gigabytes of warnings it was logging. I have this fix deployed on our servers but it hasn't been enough time to trigger this case to 100% confirm its fixed, but it seems correct to me and I have added a test to ensure the extended timestamp is added to the type 3 chunks as desired.

jamesbirtles commented 3 years ago

It has now been long enough to say this has fixed the warning from gstreamer

KallDrexx commented 3 years ago

Pushed up version 0.4.1 with this fix