diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index b648e7fd38..343672877a 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -85,7 +85,8 @@ namespace MediaBrowser.Api
/// if set to true [is video].
/// The start time ticks.
/// The source path.
- public void OnTranscodeBeginning(string path, TranscodingJobType type, Process process, bool isVideo, long? startTimeTicks, string sourcePath)
+ /// The device id.
+ public void OnTranscodeBeginning(string path, TranscodingJobType type, Process process, bool isVideo, long? startTimeTicks, string sourcePath, string deviceId)
{
lock (_activeTranscodingJobs)
{
@@ -97,7 +98,8 @@ namespace MediaBrowser.Api
ActiveRequestCount = 1,
IsVideo = isVideo,
StartTimeTicks = startTimeTicks,
- SourcePath = sourcePath
+ SourcePath = sourcePath,
+ DeviceId = deviceId
});
}
}
@@ -180,7 +182,7 @@ namespace MediaBrowser.Api
if (job.ActiveRequestCount == 0)
{
- var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 180000;
+ var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 120000;
if (job.KillTimer == null)
{
@@ -208,12 +210,14 @@ namespace MediaBrowser.Api
///
/// Kills the single transcoding job.
///
- /// The source path.
- internal void KillSingleTranscodingJob(string sourcePath)
+ /// The device id.
+ /// if set to true [is video].
+ /// sourcePath
+ internal void KillTranscodingJobs(string deviceId, bool isVideo)
{
- if (string.IsNullOrEmpty(sourcePath))
+ if (string.IsNullOrEmpty(deviceId))
{
- throw new ArgumentNullException("sourcePath");
+ throw new ArgumentNullException("deviceId");
}
var jobs = new List();
@@ -222,14 +226,12 @@ namespace MediaBrowser.Api
{
// This is really only needed for HLS.
// Progressive streams can stop on their own reliably
- jobs.AddRange(_activeTranscodingJobs.Where(i => string.Equals(sourcePath, i.SourcePath) && i.Type == TranscodingJobType.Hls));
+ jobs.AddRange(_activeTranscodingJobs.Where(i => isVideo == i.IsVideo && string.Equals(deviceId, i.DeviceId, StringComparison.OrdinalIgnoreCase)));
}
- // This method of killing is a bit of a shortcut, but it saves clients from having to send a request just for that
- // But we can only kill if there's one active job. If there are more we won't know which one to stop
- if (jobs.Count == 1)
+ foreach (var job in jobs)
{
- KillTranscodingJob(jobs.First());
+ KillTranscodingJob(job);
}
}
@@ -405,6 +407,7 @@ namespace MediaBrowser.Api
public bool IsVideo { get; set; }
public long? StartTimeTicks { get; set; }
public string SourcePath { get; set; }
+ public string DeviceId { get; set; }
}
///
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index f3164ad69a..1772cc5471 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -624,7 +624,7 @@ namespace MediaBrowser.Api.Playback
EnableRaisingEvents = true
};
- ApiEntryPoint.Instance.OnTranscodeBeginning(outputPath, TranscodingJobType, process, video != null, state.Request.StartTimeTicks, state.Item.Path);
+ ApiEntryPoint.Instance.OnTranscodeBeginning(outputPath, TranscodingJobType, process, video != null, state.Request.StartTimeTicks, state.Item.Path, state.Request.DeviceId);
Logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
diff --git a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
index f1fa86f780..be7aadec09 100644
--- a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
+++ b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
@@ -66,6 +66,14 @@ namespace MediaBrowser.Api.Playback.Hls
public string PlaylistId { get; set; }
}
+ [Route("/Videos", "DELETE")]
+ [Api(Description = "Stops an encoding process")]
+ public class StopEncodingProcess
+ {
+ [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
+ public string DeviceId { get; set; }
+ }
+
public class HlsSegmentService : BaseApiService
{
private readonly IServerApplicationPaths _appPaths;
@@ -86,6 +94,11 @@ namespace MediaBrowser.Api.Playback.Hls
return ResultFactory.GetStaticFileResult(RequestContext, file, FileShare.ReadWrite);
}
+ public void Delete(StopEncodingProcess request)
+ {
+ ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, true);
+ }
+
///
/// Gets the specified request.
///
diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs
index 07f9d31e94..339de0e6c6 100644
--- a/MediaBrowser.Api/Playback/StreamRequest.cs
+++ b/MediaBrowser.Api/Playback/StreamRequest.cs
@@ -15,6 +15,9 @@ namespace MediaBrowser.Api.Playback
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string Id { get; set; }
+ [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
+ public string DeviceId { get; set; }
+
///
/// Gets or sets the audio codec.
///
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index b588e4a852..f4976bba30 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
-using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using ServiceStack.ServiceHost;
diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
index efb1d5d43f..a43ed276df 100644
--- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
+++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
@@ -721,9 +721,6 @@ namespace MediaBrowser.Api.UserLibrary
var item = _dtoService.GetItemByDtoId(request.Id, user.Id);
- // Kill the encoding
- ApiEntryPoint.Instance.KillSingleTranscodingJob(item.Path);
-
var session = GetSession();
var info = new PlaybackStopInfo
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
index 8b8e81e8a9..e202585209 100644
--- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
+++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
@@ -384,7 +384,7 @@ namespace MediaBrowser.Common.Implementations
///
/// The type.
/// System.Object.
- protected object CreateInstance(Type type)
+ public object CreateInstance(Type type)
{
try
{
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index c634871fab..177df5afaa 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -125,5 +125,12 @@ namespace MediaBrowser.Common
///
/// Task.
Task Init();
+
+ ///
+ /// Creates the instance.
+ ///
+ /// The type.
+ /// System.Object.
+ object CreateInstance(Type type);
}
}
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs
index caf332a5b6..e900dd77e9 100644
--- a/MediaBrowser.Controller/Entities/Video.cs
+++ b/MediaBrowser.Controller/Entities/Video.cs
@@ -136,10 +136,7 @@ namespace MediaBrowser.Controller.Entities
get { return Video3DFormat.HasValue; }
}
- public bool IsHD
- {
- get { return MediaStreams != null && MediaStreams.Any(i => i.Type == MediaStreamType.Video && i.Width.HasValue && i.Width.Value >= 1280); }
- }
+ public bool IsHD { get; set; }
///
/// Gets the type of the media.
diff --git a/MediaBrowser.Model/Dto/StreamOptions.cs b/MediaBrowser.Model/Dto/StreamOptions.cs
index 0cf59183df..17fd06cb6a 100644
--- a/MediaBrowser.Model/Dto/StreamOptions.cs
+++ b/MediaBrowser.Model/Dto/StreamOptions.cs
@@ -151,6 +151,12 @@
///
/// The output file extension.
public string OutputFileExtension { get; set; }
+
+ ///
+ /// Gets or sets the device id.
+ ///
+ /// The device id.
+ public string DeviceId { get; set; }
}
///
diff --git a/MediaBrowser.Providers/Games/GameProviderFromXml.cs b/MediaBrowser.Providers/Games/GameProviderFromXml.cs
index 5e498c578d..f982e56586 100644
--- a/MediaBrowser.Providers/Games/GameProviderFromXml.cs
+++ b/MediaBrowser.Providers/Games/GameProviderFromXml.cs
@@ -92,7 +92,7 @@ namespace MediaBrowser.Providers.Games
///
public override MetadataProviderPriority Priority
{
- get { return MetadataProviderPriority.First; }
+ get { return MetadataProviderPriority.Second; }
}
}
}
\ No newline at end of file
diff --git a/MediaBrowser.Providers/Games/GameSystemProviderFromXml.cs b/MediaBrowser.Providers/Games/GameSystemProviderFromXml.cs
index ed76d08424..526170db54 100644
--- a/MediaBrowser.Providers/Games/GameSystemProviderFromXml.cs
+++ b/MediaBrowser.Providers/Games/GameSystemProviderFromXml.cs
@@ -37,7 +37,7 @@ namespace MediaBrowser.Providers.Games
/// The priority.
public override MetadataProviderPriority Priority
{
- get { return MetadataProviderPriority.First; }
+ get { return MetadataProviderPriority.Second; }
}
private const string XmlFileName = "gamesystem.xml";
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
index 727768b9f7..4fb65a764d 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs
@@ -323,6 +323,8 @@ namespace MediaBrowser.Providers.MediaInfo
FetchWtvInfo(video, force, data);
+ video.IsHD = video.MediaStreams.Any(i => i.Type == MediaStreamType.Video && i.Width.HasValue && i.Width.Value >= 1270);
+
if (chapters.Count == 0 && video.MediaStreams.Any(i => i.Type == MediaStreamType.Video))
{
AddDummyChapters(video, chapters);
diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs
index 9f3d26e24b..88def28db3 100644
--- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs
+++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs
@@ -21,7 +21,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
private readonly ILogger _logger;
private readonly IZipClient _zipClient;
- private const string Version = "ffmpeg20130904";
+ private const string Version = "ffmpeg20130904.1";
private readonly string[] _fontUrls = new[]
{
diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec
index 18187392a0..6714bb59e1 100644
--- a/Nuget/MediaBrowser.Common.Internal.nuspec
+++ b/Nuget/MediaBrowser.Common.Internal.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Common.Internal
- 3.0.216
+ 3.0.217
MediaBrowser.Common.Internal
Luke
ebr,Luke,scottisafool
@@ -12,7 +12,7 @@
Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.
Copyright © Media Browser 2013
-
+
diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec
index a9cc361a99..814a4cd7ee 100644
--- a/Nuget/MediaBrowser.Common.nuspec
+++ b/Nuget/MediaBrowser.Common.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Common
- 3.0.216
+ 3.0.217
MediaBrowser.Common
Media Browser Team
ebr,Luke,scottisafool
diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec
index 56e9222d4e..8949054475 100644
--- a/Nuget/MediaBrowser.Server.Core.nuspec
+++ b/Nuget/MediaBrowser.Server.Core.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Server.Core
- 3.0.216
+ 3.0.217
Media Browser.Server.Core
Media Browser Team
ebr,Luke,scottisafool
@@ -12,7 +12,7 @@
Contains core components required to build plugins for Media Browser Server.
Copyright © Media Browser 2013
-
+