mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Resolution is INTxINT
This commit is contained in:
parent
a60dc5803e
commit
4e1c4f00ac
1 changed files with 3 additions and 3 deletions
|
|
@ -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>
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue