aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
diff options
context:
space:
mode:
authortikuf <admin@nyalindee.com>2014-03-25 16:09:30 +1100
committertikuf <admin@nyalindee.com>2014-03-25 16:09:30 +1100
commit520b77a098a5f3755c098636821a7ff3742a055f (patch)
treeb347c31d1333520350422c3e3a08cea292fc8093 /MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
parent72bd678b9736ed0cdd8afea90e7e0c91c5b9b4c9 (diff)
parenta94a98dc6c1381c177a407139769e0cad566346b (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs50
1 files changed, 30 insertions, 20 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index 8ae61b521..9cb989fc2 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -50,39 +50,49 @@ namespace MediaBrowser.Api.Playback.Progressive
var videoRequest = state.Request as VideoStreamRequest;
// Try to infer based on the desired video codec
- if (videoRequest != null && videoRequest.VideoCodec.HasValue)
+ if (videoRequest != null && !string.IsNullOrEmpty(videoRequest.VideoCodec))
{
if (state.IsInputVideo)
{
- switch (videoRequest.VideoCodec.Value)
+ if (string.Equals(videoRequest.VideoCodec, "h264", StringComparison.OrdinalIgnoreCase))
{
- case VideoCodecs.H264:
- return ".ts";
- case VideoCodecs.Theora:
- return ".ogv";
- case VideoCodecs.Vpx:
- return ".webm";
- case VideoCodecs.Wmv:
- return ".asf";
+ return ".ts";
+ }
+ if (string.Equals(videoRequest.VideoCodec, "theora", StringComparison.OrdinalIgnoreCase))
+ {
+ return ".ogv";
+ }
+ if (string.Equals(videoRequest.VideoCodec, "vpx", StringComparison.OrdinalIgnoreCase))
+ {
+ return ".webm";
+ }
+ if (string.Equals(videoRequest.VideoCodec, "wmv", StringComparison.OrdinalIgnoreCase))
+ {
+ return ".asf";
}
}
}
// Try to infer based on the desired audio codec
- if (state.Request.AudioCodec.HasValue)
+ if (!string.IsNullOrEmpty(state.Request.AudioCodec))
{
if (!state.IsInputVideo)
{
- switch (state.Request.AudioCodec.Value)
+ if (string.Equals("aac", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
+ {
+ return ".aac";
+ }
+ if (string.Equals("mp3", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
+ {
+ return ".mp3";
+ }
+ if (string.Equals("vorbis", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
+ {
+ return ".ogg";
+ }
+ if (string.Equals("wma", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
{
- case AudioCodecs.Aac:
- return ".aac";
- case AudioCodecs.Mp3:
- return ".mp3";
- case AudioCodecs.Vorbis:
- return ".ogg";
- case AudioCodecs.Wma:
- return ".wma";
+ return ".wma";
}
}
}