[vlc-devel] Core audio S/PDIF output with latency calculation

David Fuhrmann david.fuhrmann at gmail.com
Sat Mar 9 19:48:10 CET 2013


Am 09.03.2013 um 19:23 schrieb Rémi Denis-Courmont <remi at remlab.net>:

> Le samedi 9 mars 2013 20:12:49, David Fuhrmann a écrit :
>> Attached are 3 patches which enable TimeGet for S/PDIF output using the
>> auhal output module, if someone wants to test or has (constructive)
>> comments. They seem to work fine for me and I cannot notice any
>> synchronization problems anymore.
> 
> I don't follow the maths in patch 2.

Block length (i_length) is previously (before the converter is called) calculated as CLOCK_FREQ * number of samples / rate.
The converter assumes that each block has the same number of samples when concatenating three input blocks to the resulting block, because it just uses the i_nb_samples value from the last block to allocate the memory for the final block, and it also just writes i_nb_samples * 3 as the i_nb_samples value for the final block.
Assuming that rate is not changing within these three blocks, the resulting value of i_length will also be just i_length of on input block * 3.

Best regards,
David


More information about the vlc-devel mailing list