xbmc/xbmc — pull request #2926 by popcornmix (2013-07-01 17:32:17+00:00)
Title: [rbp/omxplayer] Move buffering decision to omxplayer level

Move the decision of when to pause the GPU pipeline due to buffer underrun from the OMXPlayerAudio level to the OMXPlayer level. The decision is made based on difference in timestamps being submitted to GPU and the OMXMediaTime (i.e. how much buffered data the GPU has).

We now consider both audio and video. We pause when either is less than 0.1s. We unpause when both are greater than 0.2s, although this threshold increases each time it is hit. When this gets high, the limit will actually be AcceptsData returning false when queues are full).

Now timestamps are used for buffering decisions (rather than data buffered at audio_decode input), we can move the audio buffering to audio_decode output port. This avoids the memory being duplicated on ARM side, and also is half the size (input port is floating point, output port is 16 bit integer). I've bumped the buffer from 2s to 3s.