/** * Reads a single VTS file. * * @param vtsnTitles {@link DvdTitle} belonging to this VTS file. When this method returns, the * {@link DvdTitle} will contain detailed data. * @param dvdDir Mount directory of the DVD * @param vtsFile actual VTS file to be read */ private void readVtsFile(List<DvdTitle> vtsnTitles, File dvdDir, String vtsFile) throws IOException { try (IfoRandomAccessFile vts = new IfoRandomAccessFile(dvdDir, vtsFile)) { if (!"DVDVIDEO-VTS".equals(vts.readFixedString(12))) { throw new IfoException("No VTS file"); } Map<Integer, Long> pgcOffsets = vts.readPgcOffsets(); DvdTitleSet titleSet = vts.readTitleSet(); for (int ix = 0; ix < vtsnTitles.size(); ix++) { DvdTitle title = vtsnTitles.get(ix); title.setTitleSet(titleSet); readVtsPgc(vts, title, titleSet, pgcOffsets.get(title.getVts())); } } }