Contains fixes for multi period and live issues

Fixes #298.
Fixes occasional playback stalls for live streams (caused by changes in #295).
Fixes timeline squeezing at the end of period in multi period mpds.