diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 11:08:23 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 11:08:23 -0500 |
| commit | 4786ad704ac8ec0804e356180a41e2de0a4f7b94 (patch) | |
| tree | d6a8538aa3882a266c10329f3a8a97c82be53646 | |
| parent | b07193e1bc76555e6c7eaa1111115694d4988c86 (diff) | |
added ChannelLayout
| -rw-r--r-- | MediaBrowser.Common/MediaInfo/MediaInfoResult.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MediaStream.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs | 15 |
3 files changed, 26 insertions, 1 deletions
diff --git a/MediaBrowser.Common/MediaInfo/MediaInfoResult.cs b/MediaBrowser.Common/MediaInfo/MediaInfoResult.cs index 6fcb40300..d9a666f30 100644 --- a/MediaBrowser.Common/MediaInfo/MediaInfoResult.cs +++ b/MediaBrowser.Common/MediaInfo/MediaInfoResult.cs @@ -75,6 +75,12 @@ namespace MediaBrowser.Common.MediaInfo public int channels { get; set; } /// <summary> + /// Gets or sets the channel_layout. + /// </summary> + /// <value>The channel_layout.</value> + public string channel_layout { get; set; } + + /// <summary> /// Gets or sets the avg_frame_rate. /// </summary> /// <value>The avg_frame_rate.</value> diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 1703dbf05..5e85369b9 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -23,6 +23,12 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value>The type of the scan.</value> public string ScanType { get; set; } + + /// <summary> + /// Gets or sets the channel layout. + /// </summary> + /// <value>The channel layout.</value> + public string ChannelLayout { get; set; } /// <summary> /// Gets or sets the bit rate. diff --git a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs index f65bf9ea3..a84310310 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; |
