@Override
    public long getSampleTime() {
        long sampleTime = super.getSampleTime();
        if(sampleTime == -1) {
            return -1;
        } else {
            //Log.d(TAG, "sampletime = " + (sampleTime + mSegmentPTSOffsetUs))
            return sampleTime + mSegmentPTSOffsetUs;
        }
    }
Tries to switch to the next segment and returns true if there is one, false if there is none
and thus the current is the last one.
MediaPlayer-DASH/src/main/java/net/protyposis/android/mediaplayer/dash/DashMediaExtractor.java