aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-08-04 16:30:15 -0400
committerGitHub <noreply@github.com>2017-08-04 16:30:15 -0400
commite169eaee6cb2f91e4102f4fe7ac9075659feba95 (patch)
treea143a29cc50b65fd059727ad8f687ad32e42cecb /MediaBrowser.Api
parentdb9176521c324452ea6c4c4566d54eed5329780f (diff)
parent3fe1c25c3ea8d6519aba3b5c3ef0d6a9154413b2 (diff)
Merge pull request #2794 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs2
-rw-r--r--MediaBrowser.Api/Playback/MediaInfoService.cs20
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs2
-rw-r--r--MediaBrowser.Api/Playback/StreamState.cs4
4 files changed, 23 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 4fde66d1a..d157f1b65 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -779,7 +779,7 @@ namespace MediaBrowser.Api.Playback
if (string.IsNullOrEmpty(container))
{
container = request.Static ?
- state.InputContainer :
+ StreamBuilder.NormalizeMediaSourceFormatIntoSingleContainer(state.InputContainer, null, DlnaProfileType.Audio) :
GetOutputFileExtension(state);
}
diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs
index 536236f5f..9d2359102 100644
--- a/MediaBrowser.Api/Playback/MediaInfoService.cs
+++ b/MediaBrowser.Api/Playback/MediaInfoService.cs
@@ -117,7 +117,7 @@ namespace MediaBrowser.Api.Playback
var authInfo = _authContext.GetAuthorizationInfo(Request);
var result = await _mediaSourceManager.OpenLiveStream(request, CancellationToken.None).ConfigureAwait(false);
-
+
var profile = request.DeviceProfile;
if (profile == null)
{
@@ -144,6 +144,11 @@ namespace MediaBrowser.Api.Playback
}
}
+ if (result.MediaSource != null)
+ {
+ NormalizeMediaSourceContainer(result.MediaSource, profile, DlnaProfileType.Video);
+ }
+
return result;
}
@@ -207,9 +212,22 @@ namespace MediaBrowser.Api.Playback
}
}
+ if (info.MediaSources != null)
+ {
+ foreach (var mediaSource in info.MediaSources)
+ {
+ NormalizeMediaSourceContainer(mediaSource, profile, DlnaProfileType.Video);
+ }
+ }
+
return info;
}
+ private void NormalizeMediaSourceContainer(MediaSourceInfo mediaSource, DeviceProfile profile, DlnaProfileType type)
+ {
+ mediaSource.Container = StreamBuilder.NormalizeMediaSourceFormatIntoSingleContainer(mediaSource.Container, profile, type);
+ }
+
public async Task<object> Post(GetPostedPlaybackInfo request)
{
var result = await GetPlaybackInfo(request).ConfigureAwait(false);
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index db5c78a2f..95b8c3329 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -167,7 +167,7 @@ namespace MediaBrowser.Api.Playback.Progressive
// Static stream
if (request.Static)
{
- var contentType = state.GetMimeType(state.MediaPath);
+ var contentType = state.GetMimeType("." + state.OutputContainer, false) ?? state.GetMimeType(state.MediaPath);
using (state)
{
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs
index eecc12432..6c098deea 100644
--- a/MediaBrowser.Api/Playback/StreamState.cs
+++ b/MediaBrowser.Api/Playback/StreamState.cs
@@ -131,14 +131,14 @@ namespace MediaBrowser.Api.Playback
public long? EncodingDurationTicks { get; set; }
- public string GetMimeType(string outputPath)
+ public string GetMimeType(string outputPath, bool enableStreamDefault = true)
{
if (!string.IsNullOrEmpty(MimeType))
{
return MimeType;
}
- return MimeTypes.GetMimeType(outputPath);
+ return MimeTypes.GetMimeType(outputPath, enableStreamDefault);
}
public bool EnableDlnaHeaders { get; set; }