* improved error reporting
This commit is contained in:
parent
5d76f925eb
commit
ac9fe6ec9d
|
@ -316,9 +316,6 @@ public class MediaBindingBean {
|
||||||
String height = getMediaInfo(StreamKind.Video, 0, "Height");
|
String height = getMediaInfo(StreamKind.Video, 0, "Height");
|
||||||
String scanType = getMediaInfo(StreamKind.Video, 0, "ScanType");
|
String scanType = getMediaInfo(StreamKind.Video, 0, "ScanType");
|
||||||
|
|
||||||
if (height == null || scanType == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// e.g. 720p
|
// e.g. 720p
|
||||||
return height + Character.toLowerCase(scanType.charAt(0));
|
return height + Character.toLowerCase(scanType.charAt(0));
|
||||||
}
|
}
|
||||||
|
@ -327,9 +324,6 @@ public class MediaBindingBean {
|
||||||
public String getAudioChannels() {
|
public String getAudioChannels() {
|
||||||
String channels = getMediaInfo(StreamKind.Audio, 0, "Channel(s)_Original", "Channel(s)");
|
String channels = getMediaInfo(StreamKind.Audio, 0, "Channel(s)_Original", "Channel(s)");
|
||||||
|
|
||||||
if (channels == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// e.g. 6ch
|
// e.g. 6ch
|
||||||
return channels + "ch";
|
return channels + "ch";
|
||||||
}
|
}
|
||||||
|
@ -366,7 +360,7 @@ public class MediaBindingBean {
|
||||||
String width = getMediaInfo(StreamKind.Video, 0, "Width");
|
String width = getMediaInfo(StreamKind.Video, 0, "Width");
|
||||||
String height = getMediaInfo(StreamKind.Video, 0, "Height");
|
String height = getMediaInfo(StreamKind.Video, 0, "Height");
|
||||||
|
|
||||||
return asList(width != null ? Integer.parseInt(width) : null, height != null ? Integer.parseInt(height) : null);
|
return asList(Integer.parseInt(width), Integer.parseInt(height));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Define("original")
|
@Define("original")
|
||||||
|
@ -881,12 +875,11 @@ public class MediaBindingBean {
|
||||||
private String getMediaInfo(StreamKind streamKind, int streamNumber, String... keys) {
|
private String getMediaInfo(StreamKind streamKind, int streamNumber, String... keys) {
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
String value = getMediaInfo().get(streamKind, streamNumber, key);
|
String value = getMediaInfo().get(streamKind, streamNumber, key);
|
||||||
|
if (value.length() > 0) {
|
||||||
if (value.length() > 0)
|
|
||||||
return value;
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return undefined(String.format("%s[%d][%s]", streamKind, streamNumber, join(keys, ", ")));
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AssociativeScriptObject createBindingObject(File file, Object info, Map<File, Object> context) {
|
private AssociativeScriptObject createBindingObject(File file, Object info, Map<File, Object> context) {
|
||||||
|
|
Loading…
Reference in New Issue