Skip to content

trun encoding ignores first_sample_flags optimization #77

@jbek7

Description

@jbek7

Problem

The Trun::encode_body_ext function always sets first_sample_flags: false,
even when the first sample has different flags than subsequent samples. This
results in inefficient encoding where all sample flags are written individually.

Expected Behavior

When the first sample has different flags (e.g., keyframe with 0x02000000
followed by regular frames with 0x01010000), the encoder should use the
first_sample_flags optimization to reduce file size.

Current Behavior

  • Line 102: first_sample_flags: false, (hardcoded)
  • Line 115: 0u32.encode(buf)?; (TODO comment indicates known issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions