-
Notifications
You must be signed in to change notification settings - Fork 0
Handle TDEN frame in timed ID3v2 stream #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: varsill/ultra_low_latency
Are you sure you want to change the base?
Conversation
…with nil ID3 chunks timestamps. Add test
| {:mpeg_ts, | ||
| github: "membraneframework-labs/kim_mpeg_ts", | ||
| branch: "varsill/fix_pes_optional_header_resolving"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We either need to wait for backport of my bugfix on mpeg_ts v2 or update our dependency to mpeg_ts v3
| nil -> {nil, demuxer} | ||
| {[], updated_demuxer} -> {nil, updated_demuxer} | ||
| false -> {nil, demuxer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can easily get messed up so that a wrong clause matches. Either use withl or reshape it to be less ambiguous
| with {pos, len} <- :binary.match(payload, "TDEN"), | ||
| trailing_bytes <- :binary.part(payload, pos + len, byte_size(payload) - (pos + len)), | ||
| <<size::integer-size(4)-unit(8), _flags::16, rest::binary>> <- trailing_bytes, | ||
| <<_3, text::binary-size(size - 2), 0, _rest::binary>> <- rest do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| with {pos, len} <- :binary.match(payload, "TDEN"), | |
| trailing_bytes <- :binary.part(payload, pos + len, byte_size(payload) - (pos + len)), | |
| <<size::integer-size(4)-unit(8), _flags::16, rest::binary>> <- trailing_bytes, | |
| <<_3, text::binary-size(size - 2), 0, _rest::binary>> <- rest do | |
| with {pos, _len} <- :binary.match(payload, "TDEN"), | |
| <<_skip::binary-size(pos), "TDEN", tden::binary>> <- payload, | |
| <<size::integer-size(4)-unit(8), _flags::16, _3, text::binary-size(size - 2), 0, _rest::binary>> <- tden do |
btw, what is _3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a flag indicating encoding of the timestamps string (3 stands for UTF-8)
I think it's good enough to support just UTF-8 encoded strings (so I will make it match for exact value of 3 in this binary) - WDYT?
| &(&1.metadata.tden_tag != nil and | ||
| &1.media_type == | ||
| :video) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks weird, if can't be fixed let's change to fn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps it's because of formatting? These are just two conditions merged with AND:
&(&1.metadata.tden_tag != nil and &1.media_type == :video)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only meant the formatting is weird
Co-authored-by: Mateusz Front <[email protected]>
Required by membraneframework/membrane_core#1009