On Mon Apr 21 21:10:54 2025 +0000, Brendan McGrath wrote:
There might be a better way, but I tested by sending data directly to an instance of SAR (created with `MFCreateAudioRenderer`) and after an arbitrary number of samples (15 in my example) I would simulate a seek forward by calling `IMFPresentationClock_Pause` and then `IMFPresentationClock_Start` for 3 seconds ahead of now. I would also add 3 seconds to the PTS of all input samples from that point (the first of these samples would also have the Discontinuity flag). I could hear no audible distortion doing this, which to me suggested no buffers were ever dropped. By contrast, if I added an explicit call to `IMFStreamSink::Flush` between the `IMFPresentationClock_Pause` and `IMFPresentationClock_Start` calls; I could hear an audible skip.
Dropping buffers with PTS being too far behind would be SAR functionality I think, right away in ProcessSample() or maybe it makes more sense to do later in audio_renderer_render(). But Reset() is to drop buffered data that was already pushed to the audio device. And that last part would be difficult to test cleanly.
Do we know for sure that Flush() is used during seeking? If it is, I think it's fine.