Optimization in Multimedia
fix buffering stateness
Buffering is now properly concurent to Playing|Paused.
VLC does not have a buffering state (surprise!) but instead only sends the
event (surprise!). Hence we need to simulate the state change.
Problem with BufferingState is that it is actually concurent to Playing or Paused
meaning that while you are buffering you can also pause, thus triggering
a state change to paused. To handle this we let updateState change the
state accordingly (as we need to allow the UI to update itself, and
immediately after that we change back to buffering again.
This loop can only be interrupted by a state change to !Playing & !Paused
or by reaching a 100 % buffer caching (i.e. full cache).