Default caption parsers to non-strict parsing.

This commit is contained in:
Oliver Woodman 2015-06-18 14:12:33 +01:00
parent 39adcabf7d
commit 54d207f3ce
2 changed files with 13 additions and 5 deletions

View file

@ -77,15 +77,15 @@ public class TtmlParser implements SubtitleParser {
private final boolean strictParsing;
/**
* Equivalent to {@code TtmlParser(true)}.
* Equivalent to {@code TtmlParser(false)}.
*/
public TtmlParser() {
this(true);
this(false);
}
/**
* @param strictParsing If true, {@link #parse(InputStream, String, long)} will throw a
* {@link ParserException} if the stream contains invalid ttml. If false, the parser will
* {@link ParserException} if the stream contains invalid data. If false, the parser will
* make a best effort to ignore minor errors in the stream. Note however that a
* {@link ParserException} will still be thrown when this is not possible.
*/

View file

@ -68,13 +68,21 @@ public class WebvttParser implements SubtitleParser {
private final boolean strictParsing;
/**
* Equivalent to {@code WebvttParser(false)}.
*/
public WebvttParser() {
this(true);
this(false);
}
/**
* @param strictParsing If true, {@link #parse(InputStream, String, long)} will throw a
* {@link ParserException} if the stream contains invalid data. If false, the parser will
* make a best effort to ignore minor errors in the stream. Note however that a
* {@link ParserException} will still be thrown when this is not possible.
*/
public WebvttParser(boolean strictParsing) {
this.strictParsing = strictParsing;
textBuilder = new StringBuilder();
}