diff options
| author | tikuf <admin@nyalindee.com> | 2014-03-29 21:34:16 +1100 |
|---|---|---|
| committer | tikuf <admin@nyalindee.com> | 2014-03-29 21:34:16 +1100 |
| commit | 241be6dd93f6e0ec96ef88f0182b8985eb275995 (patch) | |
| tree | ac42c23908911099ebc2840bc6b9549de565bab6 /MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs | |
| parent | 520b77a098a5f3755c098636821a7ff3742a055f (diff) | |
| parent | 5e5b1f180c2a13152c8f318f045547c6508c5b3e (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index 184033177..fd1f65101 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -154,7 +154,8 @@ namespace MediaBrowser.Controller.MediaEncoding Codec = streamInfo.codec_name, Profile = streamInfo.profile, Level = streamInfo.level, - Index = streamInfo.index + Index = streamInfo.index, + PixelFormat = streamInfo.pix_fmt }; if (streamInfo.tags != null) @@ -196,24 +197,21 @@ namespace MediaBrowser.Controller.MediaEncoding } // Get stream bitrate - if (stream.Type != MediaStreamType.Subtitle) - { - var bitrate = 0; + var bitrate = 0; - if (!string.IsNullOrEmpty(streamInfo.bit_rate)) - { - bitrate = int.Parse(streamInfo.bit_rate, UsCulture); - } - else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate)) - { - // If the stream info doesn't have a bitrate get the value from the media format info - bitrate = int.Parse(formatInfo.bit_rate, UsCulture); - } + if (!string.IsNullOrEmpty(streamInfo.bit_rate)) + { + bitrate = int.Parse(streamInfo.bit_rate, UsCulture); + } + else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video) + { + // If the stream info doesn't have a bitrate get the value from the media format info + bitrate = int.Parse(formatInfo.bit_rate, UsCulture); + } - if (bitrate > 0) - { - stream.BitRate = bitrate; - } + if (bitrate > 0) + { + stream.BitRate = bitrate; } if (streamInfo.disposition != null) |
