aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/BaseApiService.cs25
-rw-r--r--MediaBrowser.Api/ItemUpdateService.cs5
-rw-r--r--MediaBrowser.Api/MediaBrowser.Api.csproj8
-rw-r--r--MediaBrowser.Api/Movies/MoviesService.cs2
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs7
-rw-r--r--MediaBrowser.Api/Playback/Hls/BaseHlsService.cs7
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs2
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs3
-rw-r--r--MediaBrowser.Api/Playback/Progressive/VideoService.cs10
-rw-r--r--MediaBrowser.Api/packages.config1
10 files changed, 53 insertions, 17 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 3ff432d741..ce3e963b7b 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -6,9 +6,9 @@ using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
-using ServiceStack.Text.Controller;
using ServiceStack.Web;
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -275,8 +275,8 @@ namespace MediaBrowser.Api
protected string GetPathValue(int index)
{
- var pathInfo = PathInfo.Parse(Request.PathInfo);
- var first = pathInfo.GetArgumentValue<string>(0);
+ var pathInfo = Parse(Request.PathInfo);
+ var first = pathInfo[0];
// backwards compatibility
if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) ||
@@ -285,7 +285,24 @@ namespace MediaBrowser.Api
index++;
}
- return pathInfo.GetArgumentValue<string>(index);
+ return pathInfo[index];
+ }
+
+ private static List<string> Parse(string pathUri)
+ {
+ var actionParts = pathUri.Split(new[] { "://" }, StringSplitOptions.None);
+
+ var pathInfo = actionParts[actionParts.Length - 1];
+
+ var optionsPos = pathInfo.LastIndexOf('?');
+ if (optionsPos != -1)
+ {
+ pathInfo = pathInfo.Substring(0, optionsPos);
+ }
+
+ var args = pathInfo.Split('/');
+
+ return args.Skip(1).ToList();
}
/// <summary>
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs
index 78aa5e1657..2c2e599d4d 100644
--- a/MediaBrowser.Api/ItemUpdateService.cs
+++ b/MediaBrowser.Api/ItemUpdateService.cs
@@ -295,6 +295,11 @@ namespace MediaBrowser.Api
item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
item.CustomRating = request.CustomRating;
+ if (request.ProductionLocations != null)
+ {
+ item.ProductionLocations = request.ProductionLocations.ToList();
+ }
+
item.PreferredMetadataCountryCode = request.PreferredMetadataCountryCode;
item.PreferredMetadataLanguage = request.PreferredMetadataLanguage;
diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj
index d7091df566..fde40aeb6c 100644
--- a/MediaBrowser.Api/MediaBrowser.Api.csproj
+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj
@@ -11,7 +11,7 @@
<AssemblyName>MediaBrowser.Api</AssemblyName>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
- <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<ReleaseVersion>
</ReleaseVersion>
<TargetFrameworkProfile />
@@ -50,9 +50,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CommonIO.1.0.0.9\lib\net45\CommonIO.dll</HintPath>
</Reference>
- <Reference Include="MoreLinq">
- <HintPath>..\packages\morelinq.1.4.0\lib\net35\MoreLinq.dll</HintPath>
- </Reference>
<Reference Include="Patterns.Logging">
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
</Reference>
@@ -64,9 +61,6 @@
<Reference Include="ServiceStack.Interfaces">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
</Reference>
- <Reference Include="ServiceStack.Text">
- <HintPath>..\ThirdParty\ServiceStack.Text\ServiceStack.Text.dll</HintPath>
- </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
diff --git a/MediaBrowser.Api/Movies/MoviesService.cs b/MediaBrowser.Api/Movies/MoviesService.cs
index 559bca7557..6645e0759f 100644
--- a/MediaBrowser.Api/Movies/MoviesService.cs
+++ b/MediaBrowser.Api/Movies/MoviesService.cs
@@ -8,7 +8,6 @@ using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
-using MoreLinq;
using ServiceStack;
using System;
using System.Collections.Generic;
@@ -16,6 +15,7 @@ using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Api.Movies
{
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index dc26218a52..16175229b5 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -352,6 +352,11 @@ namespace MediaBrowser.Api.Playback
return defaultEncoder;
}
+ protected virtual string GetDefaultH264Preset()
+ {
+ return "superfast";
+ }
+
/// <summary>
/// Gets the video bitrate to specify on the command line
/// </summary>
@@ -375,7 +380,7 @@ namespace MediaBrowser.Api.Playback
}
else
{
- param += "-preset superfast";
+ param += "-preset " + GetDefaultH264Preset();
}
if (encodingOptions.H264Crf >= 0 && encodingOptions.H264Crf <= 51)
diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
index 319e4bbb68..06e57bfc03 100644
--- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
@@ -256,7 +256,7 @@ namespace MediaBrowser.Api.Playback.Hls
"hls/" + Path.GetFileNameWithoutExtension(outputPath));
}
- var args = string.Format("{0} {1} {2} -map_metadata -1 -threads {3} {4} {5} -sc_threshold 0 {6} -hls_time {7} -start_number {8} -hls_list_size {9}{10} -y \"{11}\"",
+ var args = string.Format("{0} {1} {2} -map_metadata -1 -threads {3} {4} {5} -avoid_negative_ts make_zero -fflags +genpts -sc_threshold 0 {6} -hls_time {7} -start_number {8} -hls_list_size {9}{10} -y \"{11}\"",
itsOffset,
inputModifier,
GetInputArgument(state),
@@ -274,6 +274,11 @@ namespace MediaBrowser.Api.Playback.Hls
return args;
}
+ protected override string GetDefaultH264Preset()
+ {
+ return "veryfast";
+ }
+
protected virtual int GetStartNumber(StreamState state)
{
return 0;
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 97b386d73b..8dea9068de 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -886,7 +886,7 @@ namespace MediaBrowser.Api.Playback.Hls
var mapArgs = state.IsOutputVideo ? GetMapArgs(state) : string.Empty;
var enableSplittingOnNonKeyFrames = state.VideoRequest.EnableSplittingOnNonKeyFrames && string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase);
- enableSplittingOnNonKeyFrames = false;
+
// TODO: check libavformat version for 57 50.100 and use -hls_flags split_by_time
var hlsProtocolSupportsSplittingByTime = false;
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index c7258d72f7..61335a6e0d 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -91,6 +91,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
args += " -bsf:v h264_mp4toannexb";
}
+ args += " -flags +global_header";
return args;
}
@@ -113,7 +114,7 @@ namespace MediaBrowser.Api.Playback.Hls
args += GetGraphicalSubtitleParam(state, codec);
}
- args += " -flags -global_header";
+ args += " -flags +global_header";
return args;
}
diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
index 21e8845f5f..a1d4963c0a 100644
--- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
@@ -150,6 +150,11 @@ namespace MediaBrowser.Api.Playback.Progressive
args += " -copyts -avoid_negative_ts disabled -start_at_zero";
}
+ if (!state.RunTimeTicks.HasValue)
+ {
+ args += " -fflags +genpts -flags +global_header";
+ }
+
return args;
}
@@ -191,6 +196,11 @@ namespace MediaBrowser.Api.Playback.Progressive
args += GetGraphicalSubtitleParam(state, videoCodec);
}
+ if (!state.RunTimeTicks.HasValue)
+ {
+ args += " -fflags +genpts -flags +global_header";
+ }
+
return args;
}
diff --git a/MediaBrowser.Api/packages.config b/MediaBrowser.Api/packages.config
index 4f2cbae7cb..ccef6d6862 100644
--- a/MediaBrowser.Api/packages.config
+++ b/MediaBrowser.Api/packages.config
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonIO" version="1.0.0.9" targetFramework="net45" />
- <package id="morelinq" version="1.4.0" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
</packages> \ No newline at end of file