Use smallest channel value for {af} in case there are objects / channels

e.g.
Channel(s)                     : 15 objects / 6 channels
This commit is contained in:
Reinhard Pointner 2018-02-08 12:06:31 +07:00
parent 8563ae349f
commit 430d292bfe
1 changed files with 4 additions and 1 deletions

View File

@ -376,8 +376,11 @@ public class MediaBindingBean {
public String getAudioChannels() {
String channels = getMediaInfo(StreamKind.Audio, 0, "Channel(s)_Original", "Channel(s)");
// e.g. 15 objects / 6 channels
int ch = tokenize(channels, SLASH).map(s -> matchInteger(s)).filter(Objects::nonNull).min(Integer::compare).get();
// get first number, e.g. 6ch
return String.format("%dch", matchInteger(channels));
return ch + "ch";
}
@Define("channels")