Skip to content

Specify audio decoder priming sample discard and timestamp adjustment - #948

Merged
dalecurtis merged 1 commit into
mainfrom
ts_discard
Sep 21, 2026
Merged

dalecurtis merged 1 commit into
mainfrom
ts_discard

Conversation

@dalecurtis

@dalecurtis dalecurtis commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Audio decoders now automatically discard priming samples if present in the bitstream or configuration description. Decoded outputs have their initial timestamps adjusted forward by the duration of discarded priming samples.

  • Add [[priming samples to discard]] slot to AudioDecoder.
  • In configure(), initialize slot from description if specified.
  • In decode(), update slot from chunk data if specified.
  • In Output AudioData, discard priming samples up to slot value, decrement slot, discard completely dropped outputs, and adjust surviving output's timestamp forward by discarded duration rounded to microseconds.

Due to a bikeshed stacking issue, the codec registry is updated in a secondary PR.

Fixes #944
See #626

@dalecurtis
dalecurtis requested a review from padenot September 3, 2026 23:18
@dalecurtis
dalecurtis force-pushed the ts_discard branch 2 times, most recently from 58e3a3f to e3f2c04 Compare September 3, 2026 23:35

@padenot padenot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is likely fine, but we might need to settle #949 first.

Comment thread index.src.html Outdated

@padenot padenot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks a lot. As said in the other PR, this will need a follow-up, that I'll likely do.

…#944)

Audio decoders now automatically discard priming samples if present in
the bitstream or configuration description. Decoded outputs have their
initial timestamps adjusted forward by the duration of discarded priming
samples.

- Add [[priming samples to discard]] slot to AudioDecoder.
- In configure(), initialize slot from description if specified.
- In decode(), update slot from chunk data if specified.
- In Output AudioData, discard priming samples up to slot value, decrement
  slot, discard completely dropped outputs, and adjust surviving output's
  timestamp forward by discarded duration rounded to microseconds.

Fixes #944
See #626

TAG=agy
CONV=fb1a957f-7551-4aa1-b394-2244fb156d73
@dalecurtis
dalecurtis merged commit 91160a4 into main Sep 21, 2026
2 checks passed
@dalecurtis
dalecurtis deleted the ts_discard branch September 21, 2026 17:58
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.

How should timestamps be handled for audio discarded during decoding?

2 participants