Support Dolby TrueHD in Fragmented MP4

Open
#1,519 2 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

enhancement low priority
Version

Media3 1.3.1

More version details

Tested with debug build. Also tested with version 1.3.0.

Devices that reproduce the issue

Fire TV Stick 4K - 2nd Generation (2023) - 8GB (Build Model: AFTKM)

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  1. Use the ExoPlayer demo in this repository.
  2. Play a Dolby TrueHD Fragmented MP4 file by adding it to media.exolist.json.
  3. Observe the playback behavior.
Expected result
  • The video player's time should progress normally.
  • Playback should not stop.
  • No "Audio sink error" should appear in the console.
Actual result
  • The video player's time progresses very slowly and sometimes even decreases.
  • For video files (not audio-only), the video also progresses very slowly.
  • Playback stops after 55 seconds of real-time (corresponding to 4 seconds of displayed time).
  • A large number of Audio sink errors appear in the console.
Audio sink error
androidx.media3.exoplayer.audio.AudioSink$UnexpectedDiscontinuityException: Unexpected audio track timestamp discontinuity: expected 1000000226666, got 1000000014166
at androidx.media3.exoplayer.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:994)
at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:744)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.bypassRender(MediaCodecRenderer.java:2310)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:822)
at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1112)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:544)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
  • The non-fragmented version of the same content can be played without any problem.
Media

Dolby TrueHD 48kHz audio-only fragmented mp4 (10sec fragment):
https://d2pbyw961c6y8f.cloudfront.net/dolby_truehd/sunahara_5.1.4_48kHz_dthd_part1_fragmented.mp4
This is a Dolby TrueHD mp4 file created by dolby's official encoder (dolby enocoding engine) and fragmented using MP4Box tool.

Dolby TrueHD 48kHz audio-only mp4 :
https://d2pbyw961c6y8f.cloudfront.net/dolby_truehd/sunahara_5.1.4_48kHz_dthd_part1.mp4
This is the non-fragmented version of the same content. This can be played without any problem.

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from androidx/media

All issues in androidx/media

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.