From 673b0533fe847a6c3bbaa99899694b3d905d254f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 6 Apr 2016 07:16:27 +0000 Subject: [PATCH] ChannelPositions/String2: 3/2/2.1 / 3/2/0.1 (one audio stream may contain multiple multi-channel streams) --- source/net/filebot/format/MediaBindingBean.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 7bf68a86..e3f85889 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -367,6 +367,9 @@ public class MediaBindingBean { public String getAudioChannelPositions() { String channels = getMediaInfo(StreamKind.Audio, 0, "ChannelPositions/String2", "Channel(s)_Original", "Channel(s)"); + // e.g. ChannelPositions/String2: 3/2/2.1 / 3/2/0.1 (one audio stream may contain multiple multi-channel streams) + channels = SPACE.splitAsStream(channels).findFirst().orElse(channels); + // e.g. 5.1 return SLASH.splitAsStream(channels).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(1).toPlainString(); }