On Wed Apr 23 23:51:29 2025 +0000, Brendan McGrath wrote:
Just so I understand, SAR clock jumps to pts + <time it actually took
to play this sample/time it would take according to sample rate> or it jumps blindly to pts + mf sample duration, ignoring actual playback time? I don't know how well sample duration is validated against actual buffer sizes. It will jump to PTS and then progress from there at the playback rate. I don't think it uses the duration value, just buffer size to determine duration (which is easy to calculate based on frame size and sample rate).
I should add that the clock stops once playback of the provided sample(s) are complete. It won't start again until it receives another sample. But if that happens, it seems to add an implicit discontinuity.
And after a discontinuity (either implicit as described above, or explicit via a sample attribute) it doesn't just jump forward anymore. It will instead insert a period of silence, so the clock will progress at the playback rate until the next PTS, and at that point it'll start playing the next sample.