Merge pull request #2915 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-09-25 15:18:05 -04:00 committed by GitHub
commit f114b103da
6 changed files with 36 additions and 61 deletions

View File

@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.EntryPoints
try try
{ {
await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger) await new UsageReporter(_applicationHost, _httpClient, _logger)
.ReportAppUsage(client, CancellationToken.None) .ReportAppUsage(client, CancellationToken.None)
.ConfigureAwait(false); .ConfigureAwait(false);
} }
@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.EntryPoints
try try
{ {
await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger) await new UsageReporter(_applicationHost, _httpClient, _logger)
.ReportServerUsage(CancellationToken.None) .ReportServerUsage(CancellationToken.None)
.ConfigureAwait(false); .ConfigureAwait(false);
} }

View File

@ -17,15 +17,13 @@ namespace Emby.Server.Implementations.EntryPoints
{ {
private readonly IServerApplicationHost _applicationHost; private readonly IServerApplicationHost _applicationHost;
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly IUserManager _userManager;
private readonly ILogger _logger; private readonly ILogger _logger;
private const string MbAdminUrl = "https://www.mb3admin.com/admin/"; private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
public UsageReporter(IServerApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger) public UsageReporter(IServerApplicationHost applicationHost, IHttpClient httpClient, ILogger logger)
{ {
_applicationHost = applicationHost; _applicationHost = applicationHost;
_httpClient = httpClient; _httpClient = httpClient;
_userManager = userManager;
_logger = logger; _logger = logger;
} }
@ -43,12 +41,6 @@ namespace Emby.Server.Implementations.EntryPoints
{ "platform", _applicationHost.OperatingSystemDisplayName } { "platform", _applicationHost.OperatingSystemDisplayName }
}; };
var users = _userManager.Users.ToList();
data["localusers"] = users.Count(i => !i.ConnectLinkType.HasValue).ToString(CultureInfo.InvariantCulture);
data["guests"] = users.Count(i => i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest).ToString(CultureInfo.InvariantCulture);
data["linkedusers"] = users.Count(i => i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.LinkedUser).ToString(CultureInfo.InvariantCulture);
data["plugins"] = string.Join(",", _applicationHost.Plugins.Select(i => i.Id).ToArray()); data["plugins"] = string.Join(",", _applicationHost.Plugins.Select(i => i.Id).ToArray());
var logErrors = false; var logErrors = false;

View File

@ -72,8 +72,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
var cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename); var cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename);
if (_fileSystem.FileExists(cacheFile)) if (_fileSystem.FileExists(cacheFile))
{ {
//return UnzipIfNeeded(path, cacheFile); return UnzipIfNeeded(path, cacheFile);
return cacheFile;
} }
_logger.Info("Downloading xmltv listings from {0}", path); _logger.Info("Downloading xmltv listings from {0}", path);
@ -95,26 +94,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFile)); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFile));
using (var stream = _fileSystem.OpenRead(tempFile)) _fileSystem.CopyFile(tempFile, cacheFile, true);
{
using (var reader = new StreamReader(stream, Encoding.UTF8))
{
using (var fileStream = _fileSystem.GetFileStream(cacheFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
{
using (var writer = new StreamWriter(fileStream))
{
while (!reader.EndOfStream)
{
writer.WriteLine(reader.ReadLine());
}
}
}
}
}
_logger.Debug("Returning xmltv path {0}", cacheFile); return UnzipIfNeeded(path, cacheFile);
return cacheFile;
//return UnzipIfNeeded(path, cacheFile);
} }
private string UnzipIfNeeded(string originalUrl, string file) private string UnzipIfNeeded(string originalUrl, string file)

View File

@ -1367,7 +1367,8 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{ {
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase)) // If it is already 60fps then it will create an output framerate that is much too high for roku and others to handle
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase) && (state.VideoStream.RealFrameRate ?? 60) <= 30)
{ {
filters.Add("yadif=1:-1:0"); filters.Add("yadif=1:-1:0");
} }

View File

@ -777,16 +777,28 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true; bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions) foreach (ProfileCondition applyCondition in i.ApplyConditions)
{ {
bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream); int? width = videoStream == null ? null : videoStream.Width;
int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate; int? height = videoStream == null ? null : videoStream.Height;
int? audioChannels = audioStream == null ? null : audioStream.Channels; int? bitDepth = videoStream == null ? null : videoStream.BitDepth;
string audioProfile = audioStream == null ? null : audioStream.Profile; int? videoBitrate = videoStream == null ? null : videoStream.BitRate;
int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate; double? videoLevel = videoStream == null ? null : videoStream.Level;
int? inputAudioBitDepth = audioStream == null ? null : audioStream.BitDepth; string videoProfile = videoStream == null ? null : videoStream.Profile;
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;
bool? isInterlaced = videoStream == null ? (bool?)null : videoStream.IsInterlaced;
string videoCodecTag = videoStream == null ? null : videoStream.CodecTag;
bool? isAvc = videoStream == null ? null : videoStream.IsAVC;
if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio)) TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : item.Timestamp;
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
int? refFrames = videoStream == null ? null : videoStream.RefFrames;
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(options.Profile, "VideoAudioCodecProfile", applyCondition, item); LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false; applyConditions = false;
break; break;
} }
@ -815,26 +827,14 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true; bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions) foreach (ProfileCondition applyCondition in i.ApplyConditions)
{ {
int? width = videoStream == null ? null : videoStream.Width; bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream);
int? height = videoStream == null ? null : videoStream.Height; int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate;
int? bitDepth = videoStream == null ? null : videoStream.BitDepth; int? audioChannels = audioStream == null ? null : audioStream.Channels;
int? videoBitrate = videoStream == null ? null : videoStream.BitRate; string audioProfile = audioStream == null ? null : audioStream.Profile;
double? videoLevel = videoStream == null ? null : videoStream.Level; int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate;
string videoProfile = videoStream == null ? null : videoStream.Profile; int? inputAudioBitDepth = audioStream == null ? null : audioStream.BitDepth;
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;
bool? isInterlaced = videoStream == null ? (bool?)null : videoStream.IsInterlaced;
string videoCodecTag = videoStream == null ? null : videoStream.CodecTag;
bool? isAvc = videoStream == null ? null : videoStream.IsAVC;
TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : item.Timestamp; if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio))
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
int? refFrames = videoStream == null ? null : videoStream.RefFrames;
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item); LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false; applyConditions = false;

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.32.6")] [assembly: AssemblyVersion("3.2.32.7")]