From 4786ad704ac8ec0804e356180a41e2de0a4f7b94 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 12 Nov 2013 11:08:23 -0500 Subject: added ChannelLayout --- MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Providers') diff --git a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs index f65bf9ea3a..a843103106 100644 --- a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.MediaInfo; +using System.Linq; +using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.MediaInfo; @@ -201,6 +202,8 @@ namespace MediaBrowser.Providers.MediaInfo { stream.SampleRate = int.Parse(streamInfo.sample_rate, UsCulture); } + + stream.ChannelLayout = ParseChannelLayout(streamInfo.channel_layout); } else if (string.Equals(streamInfo.codec_type, "subtitle", StringComparison.OrdinalIgnoreCase)) { @@ -249,6 +252,16 @@ namespace MediaBrowser.Providers.MediaInfo return stream; } + private string ParseChannelLayout(string input) + { + if (string.IsNullOrEmpty(input)) + { + return input; + } + + return input.Split('(').FirstOrDefault(); + } + private string GetAspectRatio(MediaStreamInfo info) { var original = info.display_aspect_ratio; -- cgit v1.2.3