aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-05-02 14:23:42 -0400
committerGitHub <noreply@github.com>2017-05-02 14:23:42 -0400
commit0a9a5480c8121ee2edf8733a1bd03d31d443de7c (patch)
tree426b6ad76cfebc378a81678c3b2296d5c9ccdecf
parent090783d41aebb9e70112e8df0191526a7fe696e6 (diff)
parent54965ffc54cb6fc8f5176ea792e37f9e43ef131e (diff)
Merge pull request #2610 from MediaBrowser/dev
Dev
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs6
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs56
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs5
-rw-r--r--MediaBrowser.Providers/Manager/ProviderUtils.cs32
-rw-r--r--SharedVersion.cs2
5 files changed, 75 insertions, 26 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index a33e58eb5..f6bd21165 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -1231,7 +1231,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
RequiresOpening = false,
RequiresClosing = false,
Protocol = MediaBrowser.Model.MediaInfo.MediaProtocol.Http,
- BufferMs = 0
+ BufferMs = 0,
+ IgnoreDts = true
};
var isAudio = false;
@@ -1516,8 +1517,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
EnforceKeepUpTo(timer, seriesPath);
};
- await recorder.Record(mediaStreamInfo, recordPath, duration, onStarted, cancellationToken)
- .ConfigureAwait(false);
+ await recorder.Record(mediaStreamInfo, recordPath, duration, onStarted, cancellationToken).ConfigureAwait(false);
recordingStatus = RecordingStatus.Completed;
_logger.Info("Recording completed: {0}", recordPath);
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
index 8ee3d71b5..f59772c45 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
@@ -80,13 +80,20 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile)
{
- return Path.ChangeExtension(targetFile, "." + OutputFormat);
+ var extension = OutputFormat;
+
+ if (string.Equals(extension, "mpegts", StringComparison.OrdinalIgnoreCase))
+ {
+ extension = "ts";
+ }
+
+ return Path.ChangeExtension(targetFile, "." + extension);
}
public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
{
- var durationToken = new CancellationTokenSource(duration);
- cancellationToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, durationToken.Token).Token;
+ //var durationToken = new CancellationTokenSource(duration);
+ //cancellationToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, durationToken.Token).Token;
await RecordFromFile(mediaSource, mediaSource.Path, targetFile, duration, onStarted, cancellationToken).ConfigureAwait(false);
@@ -171,34 +178,32 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
var durationParam = " -t " + _mediaEncoder.GetTimeParameter(duration.Ticks);
- var inputModifiers = "-fflags +genpts -async 1 -vsync -1";
- if (!string.IsNullOrWhiteSpace(GetEncodingOptions().HardwareAccelerationType))
+ var flags = new List<string>();
+ if (mediaSource.IgnoreDts)
{
- inputModifiers += " -hwaccel auto";
+ flags.Add("+igndts");
+ }
+ if (mediaSource.IgnoreIndex)
+ {
+ flags.Add("+ignidx");
}
- var commandLineArgs = "-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"";
+ var inputModifiers = "-async 1 -vsync -1";
- long startTimeTicks = 0;
- //if (mediaSource.DateLiveStreamOpened.HasValue)
- //{
- // var elapsed = DateTime.UtcNow - mediaSource.DateLiveStreamOpened.Value;
- // elapsed -= TimeSpan.FromSeconds(10);
- // if (elapsed.TotalSeconds >= 0)
- // {
- // startTimeTicks = elapsed.Ticks + startTimeTicks;
- // }
- //}
+ if (flags.Count > 0)
+ {
+ inputModifiers += " -fflags " + string.Join("", flags.ToArray());
+ }
- if (mediaSource.ReadAtNativeFramerate)
+ if (!string.IsNullOrWhiteSpace(GetEncodingOptions().HardwareAccelerationType))
{
- inputModifiers += " -re";
+ inputModifiers += " -hwaccel auto";
}
- if (startTimeTicks > 0)
+ if (mediaSource.ReadAtNativeFramerate)
{
- inputModifiers = "-ss " + _mediaEncoder.GetTimeParameter(startTimeTicks) + " " + inputModifiers;
+ inputModifiers += " -re";
}
var analyzeDurationSeconds = 5;
@@ -212,7 +217,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
" -f mp4 -movflags frag_keyframe+empty_moov" :
string.Empty;
- commandLineArgs = string.Format(commandLineArgs, inputTempFile, targetFile, videoArgs, GetAudioArgs(mediaSource), subtitleArgs, durationParam, outputParam);
+ var commandLineArgs = string.Format("-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"",
+ inputTempFile,
+ targetFile,
+ videoArgs,
+ GetAudioArgs(mediaSource),
+ subtitleArgs,
+ durationParam,
+ outputParam);
return inputModifiers + " " + commandLineArgs;
}
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs
index abd7a00a9..02ebbcf16 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/MulticastStream.cs
@@ -29,6 +29,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
byte[] buffer = new byte[BufferSize];
+ if (source == null)
+ {
+ throw new ArgumentNullException("source");
+ }
+
while (!cancellationToken.IsCancellationRequested)
{
var bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false);
diff --git a/MediaBrowser.Providers/Manager/ProviderUtils.cs b/MediaBrowser.Providers/Manager/ProviderUtils.cs
index 13c12c8ff..dfa80a180 100644
--- a/MediaBrowser.Providers/Manager/ProviderUtils.cs
+++ b/MediaBrowser.Providers/Manager/ProviderUtils.cs
@@ -4,6 +4,8 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
+using System.Linq;
+using MediaBrowser.Controller.Extensions;
namespace MediaBrowser.Providers.Manager
{
@@ -122,6 +124,11 @@ namespace MediaBrowser.Providers.Manager
if (replaceData || targetResult.People == null || targetResult.People.Count == 0)
{
targetResult.People = sourceResult.People;
+
+ }
+ else if (targetResult.People != null && sourceResult.People != null)
+ {
+ MergePeople(sourceResult.People, targetResult.People);
}
}
@@ -205,6 +212,31 @@ namespace MediaBrowser.Providers.Manager
}
}
+ private static void MergePeople(List<PersonInfo> source, List<PersonInfo> target)
+ {
+ foreach (var person in target)
+ {
+ var normalizedName = person.Name.RemoveDiacritics();
+ var personInSource = source.FirstOrDefault(i => string.Equals(i.Name.RemoveDiacritics(), normalizedName, StringComparison.OrdinalIgnoreCase));
+
+ if (personInSource != null)
+ {
+ foreach (var providerId in personInSource.ProviderIds)
+ {
+ if (!person.ProviderIds.ContainsKey(providerId.Key))
+ {
+ person.ProviderIds[providerId.Key] = providerId.Value;
+ }
+ }
+
+ if (string.IsNullOrWhiteSpace(person.ImageUrl))
+ {
+ person.ImageUrl = personInSource.ImageUrl;
+ }
+ }
+ }
+ }
+
public static void MergeMetadataSettings(BaseItem source,
BaseItem target)
{
diff --git a/SharedVersion.cs b/SharedVersion.cs
index 58ac3ebe6..a0e88f57f 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.2.13.10")]
+[assembly: AssemblyVersion("3.2.13.11")]