aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
authorSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
committerSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
commite8f8d6651c86b3fd3350a5afae1d759fbbad06bd (patch)
tree6496b1525f0dfc448f0250f4fddaa634296ae94b /MediaBrowser.Api/Playback/BaseStreamingService.cs
parent28ab28768a307d1cac60ebe79163b98291068cde (diff)
parent882d0681e68c5e0ae663cca75752e4df765c8dd5 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 646230160..433299901 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -59,6 +59,8 @@ namespace MediaBrowser.Api.Playback
protected IMediaEncoder MediaEncoder { get; private set; }
protected IDtoService DtoService { get; private set; }
+ protected IFileSystem FileSystem { get; private set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="BaseStreamingService" /> class.
/// </summary>
@@ -67,8 +69,9 @@ namespace MediaBrowser.Api.Playback
/// <param name="libraryManager">The library manager.</param>
/// <param name="isoManager">The iso manager.</param>
/// <param name="mediaEncoder">The media encoder.</param>
- protected BaseStreamingService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IDtoService dtoService)
+ protected BaseStreamingService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IDtoService dtoService, IFileSystem fileSystem)
{
+ FileSystem = fileSystem;
DtoService = dtoService;
ApplicationPaths = appPaths;
UserManager = userManager;
@@ -269,7 +272,7 @@ namespace MediaBrowser.Api.Playback
// If fixed dimensions were supplied
if (request.Width.HasValue && request.Height.HasValue)
{
- return string.Format(" -vf \"scale={0}:{1}{2}\"", request.Width.Value, request.Height.Value, assSubtitleParam);
+ return string.Format(" -vf \"scale=trunc({0}/2)*2:trunc({1}/2)*2{2}\"", request.Width.Value, request.Height.Value, assSubtitleParam);
}
var isH264Output = outputVideoCodec.Equals("libx264", StringComparison.OrdinalIgnoreCase);
@@ -653,7 +656,7 @@ namespace MediaBrowser.Api.Playback
var logFilePath = Path.Combine(ApplicationPaths.LogDirectoryPath, "ffmpeg-" + Guid.NewGuid() + ".txt");
// FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
- state.LogFileStream = new FileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous);
+ state.LogFileStream = FileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true);
process.Exited += (sender, args) => OnFfMpegProcessExited(process, state);