I’m implementing a custom playback pipeline using AVSampleBufferAudioRenderer together with AVSampleBufferRenderSynchronizer.
hasSufficientMediaDataForReliablePlaybackStart appears to be the intended signal for determining when enough media has been queued to start playback.
For local playback, this works well in practice — the property becomes true after a reasonable amount of media is enqueued.
However, when the output route is AirPlay, using this property becomes difficult:
- AirPlay requires significantly more buffered media before the renderer reports sufficient data.
- The required preroll amount is much larger than for local playback.
- For short assets, it is possible to enqueue the entire audio track and still never observe hasSufficientMediaDataForReliablePlaybackStart == true.
- In that situation there is no more media data to enqueue, but the renderer still reports that playback is not ready.
Given this behavior, what is the recommended way to determine playback readiness when using AVSampleBufferAudioRenderer with AirPlay?