Samples may be clipped at the end, and this is conveyed by a granulepos that's smaller than it would otherwise be. Use the segment stop time to detect this, and calculate the right granulepos.
Samples may be clipped at the end, and this is conveyed by a granulepos that's smaller than it would otherwise be. Use the segment stop time to detect this, and calculate the right granulepos.