Skip to content
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

Do not flush eac3(joc) decoder on reuse #1346

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dwhea
Copy link
Contributor

@dwhea dwhea commented May 6, 2024

eac3(joc) decoders do not need to be flushed to be reused for the next compatible track. This change allows for gapless playback on devices with Dolby decoders that require internal re-initialization on flush.

eac3(joc) decoders do not need to be flushed to be reused for the next
compatible track. This change allows for gapless playback on devices
with Dolby decoders that require internal re-initialization on flush.
@microkatz
Copy link
Contributor

Hello @dwhea,

Thank you for creating this pull request! Just to confirm, may I ask if you have any data backing up that the eac3(joc) has independent samples (like xHE-AAC codec)?

@mzchan1
Copy link

mzchan1 commented May 16, 2024

Hi @microkatz,

To respond to your query, eac3-joc frames are structured such that each frame represents an independent time slice (e.g. 32ms of audio) that is encoded such that it does not depend on other frames, and is packaged as a single access unit in container formats such as MP4. eac3-joc is encoded via the Enhanced AC-3 bitstream format which is documented here: https://www.etsi.org/deliver/etsi_ts/102300_102399/102366/01.03.01_60/ts_102366v010301p.pdf

The core problem this pull request solves is to avoid issuing a flush event to the eac3/eac3-joc MediaCodec component under the following playback conditions:

  1. Playing back a playlist containing a series of media assets intended to seamlessly transition from the end of one media asset to the beginning of the next media asset without introducing audible gaps or other audio artifacts.
  2. During streaming audio playback (e.g. via DASH) the switching of representations within an adaptation set does not introduce audible gaps or other audio artifacts, even if the asset switches between eac3 and eac3-joc audio formats.

Please let me know if you have any further queries.

Thanks.

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.

None yet

3 participants