EventController reset() and initialize() out of order between streams in multiperiod
Created by: spiterikevin
When going from a stream to the next in multiperiod, the EventController first gets an initialized() call and then a reset() call. This should happen the other way round.
I'm still not sure why this is happening, but my guess follows:
The initialize() is triggered when the last fragment in the first stream is appended. The call stack for initialize() includes ScheduleController:onBytesAppended(), BufferController:onStreamCompleted(), StreamController:onStreamBufferingComplete(), EventController:initialize().
The reset() is trigerred when the last fragment in the first stream is played back. The call stack for reset() includes PlaybackController:onPlaybackEnded(), StreamController:onEnded(), EventController: reset().
Since initialize() and reset() happen out of order, EventController ends up with some bad state information, e.g., playbackController === null.