How does mkvmerge handle TrueHD tracks with embedded AC-3 data?
I'd like to keep thd+ac3 in a single track.
If a TrueHD track contains AC-3 data, then both data sets are completely decodable independently from another. The AC-3 part is present so that if that track is output to a hardware decoder that doesn't know about TrueHD, then that hardware decoder can still decode the AC-3 part. The only difference between the two is that TrueHD is a lossless codec while AC-3 isn't — but they've both been done from the same source material.
The Matroska specs state that one track must only contain data for one codec. Therefore mkvmerge cannot keep the AC-3 interleaved with the TrueHD part in a single track.
Starting with release 7.7.0, mkvmerge's solution is to present the AC-3 core as an additional track. This applies to TrueHD tracks read from any source file, be it from e.g. a raw TrueHD file, from a Matroska file or an MPEG transport stream. Before release 7.6.0, mkvmerge was silently discarding the AC-3 core.
But what about DTS-HD?
The situation with DTS-HD is different: even though you can decode the DTS core without its HD extension, you cannot decode the HD extension without its core. They're not two completely independent encodings, they're not two independent tracks.