docs: private void validateTimes(int idx, SubPicture subPic,
  			SubPicture subPicNext, SubPicture subPicPrev) {
  		long startTime = subPic.getStartTime();
  		long endTime = subPic.getEndTime();
  		final long delay = 5000 * 90; // default delay for missing end time (5
  										// seconds)
  
  		idx += 1; // only used for display
  
  		// get end time of last frame
  		long lastEndTime = subPicPrev != null ? subPicPrev.getEndTime() : -1;
  
  		if (startTime < lastEndTime) {
  			startTime = lastEndTime;
  		}
  
  		// get start time of next frame
  		long nextStartTime = subPicNext != null ? subPicNext.getStartTime() : 0;
  
  		if (nextStartTime == 0) {
  			if (endTime > startTime) {
  				nextStartTime = endTime;
  			} else {
  				// completely messed up:
  				// end time and next start time are invalid
  				nextStartTime = startTime + delay;
  			}
  		}
  
  		if (endTime <= startTime) {
  			endTime = startTime + delay;
  			if (endTime > nextStartTime) {
  				endTime = nextStartTime;
  			}
  		} else if (endTime > nextStartTime) {
  			endTime = nextStartTime;
  		}
  
  		int minTimePTS = configuration.getMinTimePTS();
  		if (endTime - startTime < minTimePTS) {
  			if (configuration.getFixShortFrames()) {
  				endTime = startTime + minTimePTS;
  				if (endTime > nextStartTime) {
  					endTime = nextStartTime;
  				}
  			}
  		}
  
  		if (subPic.getStartTime() != startTime) {
  			subPic.setStartTime(SubtitleUtils.syncTimePTS(startTime,
  					configuration.getFpsTrg(), configuration.getFpsTrg()));
  		}
  		if (subPic.getEndTime() != endTime) {
  			subPic.setEndTime(SubtitleUtils.syncTimePTS(endTime,
  					configuration.getFpsTrg(), configuration.getFpsTrg()));
  		}
  	}