Skip to content

TrueHD: Improve support#2379

Open
cjee21 wants to merge 11 commits intoMediaArea:masterfrom
cjee21:truehd
Open

TrueHD: Improve support#2379
cjee21 wants to merge 11 commits intoMediaArea:masterfrom
cjee21:truehd

Conversation

@cjee21
Copy link
Copy Markdown
Contributor

@cjee21 cjee21 commented Aug 19, 2025

More parsing and improved trace output for Dolby TrueHD. I put some of the new codes under a TrueHD/FBA check since I do not have MLP/FBB info or samples to know if it is the same.

@cjee21 cjee21 force-pushed the truehd branch 3 times, most recently from 1e263fa to beba6a5 Compare August 21, 2025 10:25
@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Aug 21, 2025

Tried to improve the Format Format/Info and Commercial name display but there is still some weirdness especially with legacystreamdisplay enabled:

Format                                   : MLP FBA / AC-3 AC-3 MLP FBA 16-ch
Format/Info                              : Audio Coding 3 + Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Muxing mode                              : Stream extension

@cjee21 cjee21 force-pushed the truehd branch 11 times, most recently from e48e6ae to cd6c6b7 Compare August 26, 2025 09:12
@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Aug 26, 2025

int8u reserved_data_size_bits;
Get_S1 (4, reserved_data_size_bits, "reserved_data_size_bits");
int8u padding = 8 - (reserved_data_size_bits % 8);
Skip_S1(reserved_data_size_bits, "reserved_data()");
if (padding)
Skip_S1(padding, "padding");

Does not seem to match specs:

The reserved_data_size_bits codeword indicates the value of reserved_data_size.

The reserved_data_size indicates the length of the reserved_data element plus the padding element in bytes and can be calculated by the following equation:

                        reserved_data_size = reserved_data_size_bits+ 1

In this equation, the bits of the reserved_data_size_bits element are interpreted as an unsigned integer.

@cjee21 cjee21 force-pushed the truehd branch 14 times, most recently from 9b36853 to ad3e853 Compare August 27, 2025 11:01
@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Aug 28, 2025

Not related to this PR but noticed that for raw TrueHD stream, even with full parse, there is no duration and bitrate in output.

@JeromeMartinez
Copy link
Copy Markdown
Member

Not related to this PR but noticed that for raw TrueHD stream, even with full parse, there is no duration and bitrate in output.

It was not implemented for full parse, but should be easy, I'll give it a look.
For non full parse, there is no timestamp and it is VBR so not possible to get it.

@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Oct 22, 2025

Malformed EMDF E-AC3 samples that can crash Dolby's official decoders (CVE-2025-54957) may be useful for testing and can be found here:
https://project-zero.issues.chromium.org/issues/428075495

@JeromeMartinez
Copy link
Copy Markdown
Member

FYI I checked with all files I have but some files with JOC are no more detected, I'll work on finding the source of the regression in your code.
Do you have files which were not well parsed without this PR? For trying to suggest a change without removing the new support.

@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Feb 8, 2026

This PR is just for expanding MediaTrace and getting more info from TrueHD and DRC info from some JOC as well as trying to improve the display when both TrueHD and Ac3 in same track (but still not well done yet). It should not affect which files are parsed or not so

files which were not well parsed without this PR

No.

@cjee21
Copy link
Copy Markdown
Contributor Author

cjee21 commented Feb 8, 2026

One more thing is I think the metadata from AC3 (dialnorm and many lines at the bottom) should not be shown when TrueHD and AC3 in the same track and legacy stream display is not enabled. That AC3 DRC data is not used by TrueHD. Some people may misinterpret it or find it strange that when remuxed to MKV for example and the TrueHD is split from AC3, the TrueHD track no longer has such metadata.

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.

2 participants