DashHandler.getSegments called after DashHandler.isMediaFinished + javascript fp precision hazards
Created by: waqarz
In DashHandler.getNext, getSegments is being called after checking isMediaFinished; the former can potentially change the results of isMediaFinished after the call (more segments may be added). In one of the services I am testing, this locks/crashes the code down since the segment added by this call to getSegments is after period end. Hence the calls here are adjusted.
I cannot however completely verify this because when I look at the call-stack for the case when the code crashes, I cannot understand the complete call-flow (40+ calls to 26 unique methods in 12 different classes to get index for a segment). Still if I test DashHandler this seems OK; an expert should verify this.