diff --git a/source/net/sourceforge/filebot/subtitle/MicroDVDReader.java b/source/net/sourceforge/filebot/subtitle/MicroDVDReader.java index 573b9870..502c2c1c 100644 --- a/source/net/sourceforge/filebot/subtitle/MicroDVDReader.java +++ b/source/net/sourceforge/filebot/subtitle/MicroDVDReader.java @@ -48,6 +48,9 @@ public class MicroDVDReader extends SubtitleReader { int endFrame = Integer.parseInt(properties.get(1)); String text = line.substring(from).trim(); + // cancel format markers + text = text.replaceAll("\\{[^\\}]*\\}", ""); + if (startFrame == 1 && endFrame == 1) { // override fps fps = Double.parseDouble(text); diff --git a/source/net/sourceforge/filebot/subtitle/SubViewerReader.java b/source/net/sourceforge/filebot/subtitle/SubViewerReader.java index 8a0b9b73..a22b5a04 100644 --- a/source/net/sourceforge/filebot/subtitle/SubViewerReader.java +++ b/source/net/sourceforge/filebot/subtitle/SubViewerReader.java @@ -6,6 +6,7 @@ import static java.util.regex.Pattern.*; import static net.sourceforge.tuned.StringUtilities.*; import java.text.DateFormat; +import java.text.ParseException; import java.util.InputMismatchException; import java.util.regex.Pattern; @@ -39,6 +40,9 @@ public class SubViewerReader extends SubtitleReader { String[] lines = newline.split(scanner.nextLine()); return new SubtitleElement(t1, t2, join(lines, "\n")); + } catch (ParseException e) { + // can't parse interval, ignore line + return null; } catch (InputMismatchException e) { // can't parse interval, ignore line return null; diff --git a/source/net/sourceforge/filebot/subtitle/SubtitleReader.java b/source/net/sourceforge/filebot/subtitle/SubtitleReader.java index 7dab25fe..ff6b1c0b 100644 --- a/source/net/sourceforge/filebot/subtitle/SubtitleReader.java +++ b/source/net/sourceforge/filebot/subtitle/SubtitleReader.java @@ -33,7 +33,7 @@ public abstract class SubtitleReader implements Iterator, Close current = readNext(); } catch (Exception e) { // log and ignore - Logger.getLogger(getClass().getName()).log(Level.WARNING, e.toString(), e); + Logger.getLogger(getClass().getName()).log(Level.WARNING, "Illegal input: " + e.getMessage()); } }