Dolby TrueHD passthrough - modified mpv build
As some of you may have noticed, passing through Dolby TrueHD content can be hit or miss - some files work, others won’t - this build tries to fix this under specific circumstances.
Why is the current mpv lib broken?
Well, 3 years ago I opened a bug report on the FFmpeg bug tracker site°1 because I noticed a bug with the passthrough logic. When playing back movie files containing a TrueHD track that exceeds a bitrate of 11mbit the player would stop or crash. Time has passed and the issue was “fixed” - well playing back files with a bitrate over 11mbit works fine now but other issues have been introduced by this - which makes TrueHD passthrough nearly unusable. To name two, scrubbing does not work reliably - audio stops when skipping inside the file… Or playing back a file that stems from a source where seamless branching was needed, audio will stop when it hits such a spot.
To address this, I opened a new bug report on the FFmpeg bug track site°2, but nobody seems to care…
How is this fixed?
There are two types of fixes:
-
Actual fix
This fix incorporates a code change made by @gbooker02 to possibly fix the TrueHD passthrough problem.
The code change can be found here =>
Potential TrueHD FFmpeg Passthrough Fix · GitHub
The rest of the(/libavformat/spdifenc.c)file is kept up-to-date so it stays compatible with upstream FFmpeg. The total modified spdifenc.c file can be found here => FFmpeg/libavformat/spdifenc.c at master-3 · mitzsch/FFmpeg · GitHub -
Revert to the original TrueHD logic
All I have done here is revert these truehd-related commits, and keep the rest of the file(/libavformat/spdifenc.c)up-to-date - so it stays compatible with upstream FFmpeg.
The modified “original TrueHD logic” spdifenc.c file can be found here:
FFmpeg/libavformat/spdifenc.c at master-2 · mitzsch/FFmpeg · GitHub
What does not work with this build?
-
Actual fix build
This build may show some weird behavior with seamless branching files on some receivers. (dropouts…) -
Revert to the original TrueHD logic
Files with a TrueHD bitrate over 11mbit will not work, playback will be stuck.
Where to find the builds?
Modified mpv builds with the actual TrueHD fix can be found here:
Note: This repo only contains “actual TrueHD fix” releases.
If you need builds with the “reverted TrueHD logic” write me a PM and I will send you a build. I build them for myself, as I mainly use them.
How to install?
Follow this guide => HTPC Tips and Tricks - #3 by gbooker02
CAVE!
With every update of Plex HTPC the libmpv-2.dll gets overwritten and needs to be replaced again.
The user @Harze2k wrote a PowerShell script to automate this process. It checks for updates and replaces the libmpv-2.dll if necessary.
It can be found here => Script to automatically check/update both plex htpc and mitzsch's mpv with TrueHD support
Note about HDR - breaking change!
Starting with build 2025-07-30 17:57 ( Release 2025-07-30 17:57 · mitzsch/mpv-winbuild · GitHub ) the libmpv-2.dll now includes the newly introduced “–target-colorspace-hint-mode” option. This defaults to mpv doing the tonemapping and not the display (= no metadata passthrough). To restore the old behavior, add target-colorspace-hint-mode=source to your mpv.conf!
Linked sites:
°1 Making sure you're not a bot!
°2 Making sure you're not a bot!
Have fun with proper TrueHD playback!