fix various issues  :
factorize code
update playlist duration according to PTS drifts (this regression was introduced by https://github.com/mangui/HLSprovider/commit/8009cdecdc4decfc5e720fc4046352f44324e2d5)
improve level switching in live playlists :
- ensure that new playlist has been refreshed before try to load a new fragment.
- correctly handle live playlist discontinuity when switching level : check discontinuity between last and new segment from new playlist