increase live stream analyze duration
This commit is contained in:
parent
ce47f63389
commit
1de6b4607f
|
@ -16,7 +16,8 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
private readonly IMediaEncoder _mediaEncoder;
|
private readonly IMediaEncoder _mediaEncoder;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
const int AnalyzeDurationMs = 1000;
|
const int ProbeAnalyzeDurationMs = 2000;
|
||||||
|
const int PlaybackAnalyzeDurationMs = 1000;
|
||||||
|
|
||||||
public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger)
|
public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +37,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
Protocol = mediaSource.Protocol,
|
Protocol = mediaSource.Protocol,
|
||||||
MediaType = isAudio ? DlnaProfileType.Audio : DlnaProfileType.Video,
|
MediaType = isAudio ? DlnaProfileType.Audio : DlnaProfileType.Video,
|
||||||
ExtractChapters = false,
|
ExtractChapters = false,
|
||||||
AnalyzeDurationMs = AnalyzeDurationMs
|
AnalyzeDurationMs = ProbeAnalyzeDurationMs
|
||||||
|
|
||||||
}, cancellationToken).ConfigureAwait(false);
|
}, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
// Try to estimate this
|
// Try to estimate this
|
||||||
mediaSource.InferTotalBitrate(true);
|
mediaSource.InferTotalBitrate(true);
|
||||||
|
|
||||||
mediaSource.AnalyzeDurationMs = AnalyzeDurationMs;
|
mediaSource.AnalyzeDurationMs = PlaybackAnalyzeDurationMs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,8 @@ namespace SocketHttpListener.Net
|
||||||
OutputStream.BeginWrite(responseEntity, 0, responseEntity.Length, iar =>
|
OutputStream.BeginWrite(responseEntity, 0, responseEntity.Length, iar =>
|
||||||
{
|
{
|
||||||
var thisRef = (HttpListenerResponse)iar.AsyncState;
|
var thisRef = (HttpListenerResponse)iar.AsyncState;
|
||||||
|
try
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
thisRef.OutputStream.EndWrite(iar);
|
thisRef.OutputStream.EndWrite(iar);
|
||||||
|
@ -136,6 +138,11 @@ namespace SocketHttpListener.Net
|
||||||
{
|
{
|
||||||
thisRef.Close(false);
|
thisRef.Close(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// In case response was disposed during this time
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user