ebml-go
ebml-go copied to clipboard
fix: stop adding unnecessary null terminators to strings
When using this project with AWS Kinesis Video, Kinesis Video fails to parse the CodecID field of an MKV TrackEntry due to the fact that this package guarantees that strings will always have null terminators.
According to the EBML spec, null termination is allowed but not recommended except in the case where a field is being overwritten in place, such that the subsequent data in a string value can be ignored without fully overwriting it (in case the field is very large for example).
https://www.rfc-editor.org/rfc/rfc8794.html#terminating-elements
While the behavior in this package is technically correct, for better compatibility it is advisable not to null terminate strings unless absolutely necessary.
Looks like some tests aren't updated
I'm happy to go through and update more tests, do you have any feedback on the change itself though?
I think the change itself is reasonable
@at-wat Sorry for the long delay here but I think I've fixed the broken test, at least go test ./... passes now.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
9791271) 99.25% compared to head (98735d0) 99.25%. Report is 2 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #172 +/- ##
=======================================
Coverage 99.25% 99.25%
=======================================
Files 24 24
Lines 1886 1886
=======================================
Hits 1872 1872
Misses 9 9
Partials 5 5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.