docs: private void scanSubtitles() {
  		boolean convertFPS = configuration.getConvertFPS();
  		subPictures = new SubPicture[subtitleStream.getFrameCount()];
  		double factTS = convertFPS ? configuration.getFPSSrc()
  				/ configuration.getFpsTrg() : 1.0;
  
  		double fx;
  		double fy;
  		fx = 1.0;
  		fy = 1.0;
  
  		// first run: clone source subpics, apply speedup/down,
  		SubPicture picSrc;
  		for (int i = 0; i < subPictures.length; i++) {
  			picSrc = subtitleStream.getSubPicture(i);
  			subPictures[i] = new SubPicture(picSrc);
  			long ts = picSrc.getStartTime();
  			long te = picSrc.getEndTime();
  			// copy time stamps and apply speedup/speeddown
  			int delayPTS = configuration.getDelayPTS();
  			if (!convertFPS) {
  				subPictures[i].setStartTime(ts + delayPTS);
  				subPictures[i].setEndTime(te + delayPTS);
  			} else {
  				subPictures[i].setStartTime((long) (ts * factTS + 0.5)
  						+ delayPTS);
  				subPictures[i]
  						.setEndTime((long) (te * factTS + 0.5) + delayPTS);
  			}
  			// synchronize to target frame rate
  			subPictures[i].setStartTime(SubtitleUtils.syncTimePTS(
  					subPictures[i].getStartTime(), configuration.getFpsTrg(),
  					configuration.getFpsTrg()));
  			subPictures[i].setEndTime(SubtitleUtils.syncTimePTS(
  					subPictures[i].getEndTime(), configuration.getFpsTrg(),
  					configuration.getFpsTrg()));
  
  			// set forced flag
  			SubPicture picTrg = subPictures[i];
  
  			double scaleX;
  			double scaleY;
  			if (configuration.getConvertResolution()) {
  				// adjust image sizes and offsets
  				// determine scaling factors
  				picTrg.setWidth(configuration.getOutputResolution()
  						.getDimensions()[0]);
  				picTrg.setHeight(configuration.getOutputResolution()
  						.getDimensions()[1]);
  				scaleX = (double) picTrg.getWidth() / picSrc.getWidth();
  				scaleY = (double) picTrg.getHeight() / picSrc.getHeight();
  			} else {
  				picTrg.setWidth(picSrc.getWidth());
  				picTrg.setHeight(picSrc.getHeight());
  				scaleX = 1.0;
  				scaleY = 1.0;
  			}
  			int w = (int) (picSrc.getImageWidth() * scaleX * fx + 0.5);
  			if (w < MIN_IMAGE_DIMENSION) {
  				w = picSrc.getImageWidth();
  			} else if (w > picTrg.getWidth()) {
  				w = picTrg.getWidth();
  			}
  
  			int h = (int) (picSrc.getImageHeight() * scaleY * fy + 0.5);
  			if (h < MIN_IMAGE_DIMENSION) {
  				h = picSrc.getImageHeight();
  			} else if (h > picTrg.getHeight()) {
  				h = picTrg.getHeight();
  			}
  			picTrg.setImageWidth(w);
  			picTrg.setImageHeight(h);
  
  			int xOfs = (int) (picSrc.getXOffset() * scaleX + 0.5);
  			int spaceSrc = (int) ((picSrc.getWidth() - picSrc.getImageWidth())
  					* scaleX + 0.5);
  			int spaceTrg = picTrg.getWidth() - w;
  			xOfs += (spaceTrg - spaceSrc) / 2;
  			if (xOfs < 0) {
  				xOfs = 0;
  			} else if (xOfs + w > picTrg.getWidth()) {
  				xOfs = picTrg.getWidth() - w;
  			}
  			picTrg.setOfsX(xOfs);
  
  			int yOfs = (int) (picSrc.getYOffset() * scaleY + 0.5);
  			spaceSrc = (int) ((picSrc.getHeight() - picSrc.getImageHeight())
  					* scaleY + 0.5);
  			spaceTrg = picTrg.getHeight() - h;
  			yOfs += (spaceTrg - spaceSrc) / 2;
  			if (yOfs + h > picTrg.getHeight()) {
  				yOfs = picTrg.getHeight() - h;
  			}
  			picTrg.setOfsY(yOfs);
  		}
  
  		// 2nd run: validate times
  		SubPicture picPrev = null;
  		SubPicture picNext;
  		for (int i = 0; i < subPictures.length; i++) {
  			if (i < subPictures.length - 1) {
  				picNext = subPictures[i + 1];
  			} else {
  				picNext = null;
  			}
  			picSrc = subPictures[i];
  			validateTimes(i, subPictures[i], picNext, picPrev);
  			picPrev = picSrc;
  		}
  	}