Branch playback means switching the currently playing stream to another stream. By registering the MPEG handle when the next stream to be played is determined, playback will switch to the next stream at the end of the current stream or by a forced switching function.
The timing of switching may be as follows.
When a system end code is detected
When EOR bit is detected
When the forced switching function is called
7.1 Clearing the buffer
In order to perform branch playback smoothly, the decode buffer must be cleared in a timely manner. The video has a VBV buffer in front of the decoder and a frame buffer in the back.
Audio has a 1 sector buffer before the decoder. Therefore, there are two buffers that can be cleared for video: the VBV buffer or VBV + frame buffer, and for audio, it is only the sector buffer.
(1) For video
Clear target
Figure 7.1 MPEG video buffer structure
clear timing
Clear immediately.
Clear after waiting for I or P picture decoding to start.
Due to the nature of MPEG video streams, clearing the VBV buffer after waiting for I or P picture decoding to start will result in a very clean connection. At other timings, the response is slightly better, but the same frame may be output or frames may be skipped.