Add gapless support
This merge request adds support for gapless playback in VLC.
It is enabled by default, use "--no-gapless" to disable it.
When enabled, the player will try to start the next input when the current input is near the end (3seconds to the end currently). This next input will be started in gapless mode. This is like the normal mode except:
- The es_out will wait to be resumed by the player after its buffering is complete (from EsOutDecodersStopBuffering())
- All decoders started in gapless mode will wait to be resumed by the es_out before configuring their first output.
- The audio decoder started in gapless mode will configure the main aout (the one used by the current played input) for gapless.
The audio output can now be configured in gapless mode, that is:
- The drain call will be postponed (and called back if the gapless transition failed)
- The stop call will save the current stream for future usage
- The next start call will re-use the last stream if format are compatible, or end the gapless transition if not (then drain(); stop(); will be called on the previous stream)
- The first play call will finish the gapless transition if the pts and clock jitter are compatible with last aout stream delay.