Skip to content

Conversation

@varsill
Copy link
Collaborator

@varsill varsill commented Oct 16, 2025

@varsill varsill marked this pull request as draft October 16, 2025 09:26
@varsill varsill marked this pull request as ready for review November 5, 2025 15:20
@varsill varsill requested a review from mat-hek November 5, 2025 15:37
Comment on lines +45 to +47
{:mpeg_ts,
github: "membraneframework-labs/kim_mpeg_ts",
branch: "varsill/fix_pes_optional_header_resolving"},
Copy link
Collaborator Author

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

Comment on lines +119 to +121
nil -> {nil, demuxer}
{[], updated_demuxer} -> {nil, updated_demuxer}
false -> {nil, demuxer}
Copy link
Member

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

Comment on lines 126 to 129
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Collaborator Author

@varsill varsill Nov 7, 2025

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?

Comment on lines +155 to +158
&(&1.metadata.tden_tag != nil and
&1.media_type ==
:video)
)
Copy link
Member

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

Copy link
Collaborator Author

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)

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants