2012-02-09, 13:15
DanielaE Wrote:Thanks for testing! While I have cherry-picked your patch into my repo to play with it for a while, I came to the conclusion that neither the original code nor your fix is correct - for two reasons: [...]
Your argument sounds reasonable, however the current solution should still work correctly. Muxer output should have the same duration as the encoded packet to stay IEC compliant (the audio clock must be kept in sync with the decoded audio).
However, my patch was not working correctly (it broke decoding) and was implemented in the wrong place (should not be in CDVDPlayerAudio). I had some time to track down the issue. The root cause is that duration is calculated from codec samplerate and not the muxed samplerate. dts-ma is muxed into 2 ch 768 kHz while dts core is 2 ch 48 kHz, that's where the 16x duration diff comes from. The new patch returns the correct muxer rate for dts-ma.