Buffer management changes
Created by: epiclabsDASH
Changes in buffer management to fix issues #2187 (closed) and #2239 (closed).
- epsilon value used for time -> segment index conversion is now configurable using MediaPlayer. setSegmentOverlapToleranceTime. Its default value has also been reduced to be 0.05 seconds.
- epsilon value is never taken into account for seeking operations. This is to ensure segments lists are always updated taking into account the specified time, ensuring video/audio alignment that was the root of the issue behind #2187 (closed).
- Changes in "pruning" logic. Previous approach was pruning just buffer behind playback position what caused unrecoverable failures when a user did multiple seek back operations (quota exceeded reported by browser that couldn't be fixed pruning previous buffer as most of allocated buffer was ahead). In the current approach we still are optimistic to ensure efficiency, in pruning operations we continue removing just buffer behind playback position but, in case of a quota exceed situation, we remove buffer ahead that is further than the defined stable buffer length. Also related with #2187 (closed).
- Taking advantage of changes doing in previous point, modifications has also been done to fix #2239 (closed). This fully removes the buffer when there is a track change and its switch mode is set to "always replace". With this, audio track transitions are instantaneous.
This PR depends on #2220. Don't merge before that one.