cainteoir_waveform_view: fix sample calculation at the end of the data