aout: fix discontinuity handling
All aout modules handling async timing report base their first timing according to the first pts and converted date, then the points can only increase without any discontinuity.
This make discontinuity handling inside modules an intricate job.
This MR propose to handle the PTS discontinuity inside the core by doing the following:
- Drain the current stream in case of discontinuity
- Check from future Play() calls if the stream is drained
- Keep blocks in a list while waiting for the drain
- Flush when the stream is finally drained
- Play back all blocks that were saved
For now, the discontinuity is only triggered if the block has the BLOCK_FLAG_DISCONTINUITY
flags.
It will also be triggered when switching to a new clock context, cf. !5144 (closed) with something that looks like:
if (clock_id != stream->sync.clock_id)
{
stream->sync.clock_id = clock_id;
return stream_StartDiscontinuity(stream, block);
}