aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-26 15:21:29 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-26 15:21:29 -0400
commit6ac7675c15af7cf5ea2aaed6c9e329af7eb62c44 (patch)
tree13fb5bdc5b1eb8d82b9d603da0285ed459b16e23 /MediaBrowser.Controller/MediaEncoding
parent80d84225b7e105add55b44293beb7916ebda140f (diff)
add dlna service methods
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs32
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)