* improved error reporting

This commit is contained in:
Reinhard Pointner 2014-08-11 07:10:57 +00:00
parent 5d76f925eb
commit ac9fe6ec9d
1 changed files with 4 additions and 11 deletions

View File

@ -316,9 +316,6 @@ public class MediaBindingBean {
String height = getMediaInfo(StreamKind.Video, 0, "Height");
String scanType = getMediaInfo(StreamKind.Video, 0, "ScanType");
if (height == null || scanType == null)
return null;
// e.g. 720p
return height + Character.toLowerCase(scanType.charAt(0));
}
@ -327,9 +324,6 @@ public class MediaBindingBean {
public String getAudioChannels() {
String channels = getMediaInfo(StreamKind.Audio, 0, "Channel(s)_Original", "Channel(s)");
if (channels == null)
return null;
// e.g. 6ch
return channels + "ch";
}
@ -366,7 +360,7 @@ public class MediaBindingBean {
String width = getMediaInfo(StreamKind.Video, 0, "Width");
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")
@ -881,12 +875,11 @@ public class MediaBindingBean {
private String getMediaInfo(StreamKind streamKind, int streamNumber, String... keys) {
for (String key : keys) {
String value = getMediaInfo().get(streamKind, streamNumber, key);
if (value.length() > 0)
if (value.length() > 0) {
return value;
}
}
return null;
return undefined(String.format("%s[%d][%s]", streamKind, streamNumber, join(keys, ", ")));
}
private AssociativeScriptObject createBindingObject(File file, Object info, Map<File, Object> context) {