Commit 4e1c4f00 by Oliver Woodman

Resolution is INTxINT

parent a60dc580
...@@ -72,7 +72,7 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist> ...@@ -72,7 +72,7 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
private static final Pattern CODECS_ATTR_REGEX = private static final Pattern CODECS_ATTR_REGEX =
Pattern.compile(CODECS_ATTR + "=\"(.+?)\""); Pattern.compile(CODECS_ATTR + "=\"(.+?)\"");
private static final Pattern RESOLUTION_ATTR_REGEX = private static final Pattern RESOLUTION_ATTR_REGEX =
Pattern.compile(RESOLUTION_ATTR + "=(\\d+(\\.\\d+)?x\\d+(\\.\\d+)?)"); Pattern.compile(RESOLUTION_ATTR + "=(\\d+x\\d+)");
private static final Pattern MEDIA_DURATION_REGEX = private static final Pattern MEDIA_DURATION_REGEX =
Pattern.compile(MEDIA_DURATION_TAG + ":([\\d.]+),"); Pattern.compile(MEDIA_DURATION_TAG + ":([\\d.]+),");
private static final Pattern MEDIA_SEQUENCE_REGEX = private static final Pattern MEDIA_SEQUENCE_REGEX =
...@@ -168,12 +168,12 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist> ...@@ -168,12 +168,12 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
RESOLUTION_ATTR_REGEX); RESOLUTION_ATTR_REGEX);
if (resolutionString != null) { if (resolutionString != null) {
String[] widthAndHeight = resolutionString.split("x"); String[] widthAndHeight = resolutionString.split("x");
width = Math.round(Float.parseFloat(widthAndHeight[0])); width = Integer.parseInt(widthAndHeight[0]);
if (width <= 0) { if (width <= 0) {
// Width was invalid. // Width was invalid.
width = -1; width = -1;
} }
height = Math.round(Float.parseFloat(widthAndHeight[1])); height = Integer.parseInt(widthAndHeight[1]);
if (height <= 0) { if (height <= 0) {
// Height was invalid. // Height was invalid.
height = -1; height = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment