Skip to content

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

Open
dalecurtis wants to merge 1 commit into
mainfrom
ts_discard
Open

Specify audio decoder priming sample discard and timestamp adjustment#948
dalecurtis wants to merge 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

…#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

@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.

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