add db startup error handling

This commit is contained in:
Luke Pulverenti
2017-02-17 16:11:13 -05:00
parent b51f00feb6
commit 36f8eb1149
16 changed files with 307 additions and 61 deletions

View File

@@ -1172,7 +1172,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
};
var isAudio = false;
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, false, cancellationToken).ConfigureAwait(false);
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, cancellationToken).ConfigureAwait(false);
return new List<MediaSourceInfo>
{

View File

@@ -260,7 +260,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
_logger.Info("Calling recording process.WaitForExit for {0}", _targetPath);
if (_process.WaitForExit(5000))
if (_process.WaitForExit(10000))
{
return;
}

View File

@@ -22,7 +22,7 @@ namespace Emby.Server.Implementations.LiveTv
_logger = logger;
}
public async Task AddMediaInfoWithProbe(MediaSourceInfo mediaSource, bool isAudio, bool assumeInterlaced, CancellationToken cancellationToken)
public async Task AddMediaInfoWithProbe(MediaSourceInfo mediaSource, bool isAudio, CancellationToken cancellationToken)
{
var originalRuntime = mediaSource.RunTimeTicks;
@@ -96,17 +96,6 @@ namespace Emby.Server.Implementations.LiveTv
videoStream.IsAVC = null;
}
if (assumeInterlaced)
{
foreach (var mediaStream in mediaSource.MediaStreams)
{
if (mediaStream.Type == MediaStreamType.Video)
{
mediaStream.IsInterlaced = true;
}
}
}
// Try to estimate this
mediaSource.InferTotalBitrate(true);
}

View File

@@ -126,14 +126,12 @@ namespace Emby.Server.Implementations.LiveTv
var keys = openToken.Split(new[] { StreamIdDelimeter }, 3);
var mediaSourceId = keys.Length >= 3 ? keys[2] : null;
IDirectStreamProvider directStreamProvider = null;
var assumeInterlaced = false;
if (string.Equals(keys[0], typeof(LiveTvChannel).Name, StringComparison.OrdinalIgnoreCase))
{
var info = await _liveTvManager.GetChannelStream(keys[1], mediaSourceId, cancellationToken).ConfigureAwait(false);
stream = info.Item1;
directStreamProvider = info.Item2;
assumeInterlaced = info.Item3;
}
else
{
@@ -148,7 +146,7 @@ namespace Emby.Server.Implementations.LiveTv
}
else
{
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, assumeInterlaced, cancellationToken).ConfigureAwait(false);
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, cancellationToken).ConfigureAwait(false);
}
}
catch (Exception ex)