mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Fix ffmpeg analyze duration env var taking priority over media source
This commit is contained in:
parent
b344771f8a
commit
80c68b8948
@ -4976,14 +4976,14 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
// The default value of -probesize is more than enough, so leave it as is.
|
// The default value of -probesize is more than enough, so leave it as is.
|
||||||
var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
|
var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
|
if (state.MediaSource.AnalyzeDurationMs > 0)
|
||||||
{
|
|
||||||
analyzeDurationArgument = "-analyzeduration " + ffmpegAnalyzeDuration;
|
|
||||||
}
|
|
||||||
else if (state.MediaSource.AnalyzeDurationMs.HasValue)
|
|
||||||
{
|
{
|
||||||
analyzeDurationArgument = "-analyzeduration " + (state.MediaSource.AnalyzeDurationMs.Value * 1000).ToString(CultureInfo.InvariantCulture);
|
analyzeDurationArgument = "-analyzeduration " + (state.MediaSource.AnalyzeDurationMs.Value * 1000).ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
|
||||||
|
{
|
||||||
|
analyzeDurationArgument = "-analyzeduration " + ffmpegAnalyzeDuration;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(analyzeDurationArgument))
|
if (!string.IsNullOrEmpty(analyzeDurationArgument))
|
||||||
{
|
{
|
||||||
|
@ -376,15 +376,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
string analyzeDuration = string.Empty;
|
string analyzeDuration = string.Empty;
|
||||||
string ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
|
string ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
|
if (request.MediaSource.AnalyzeDurationMs > 0)
|
||||||
{
|
|
||||||
analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration;
|
|
||||||
}
|
|
||||||
else if (request.MediaSource.AnalyzeDurationMs > 0)
|
|
||||||
{
|
{
|
||||||
analyzeDuration = "-analyzeduration " +
|
analyzeDuration = "-analyzeduration " +
|
||||||
(request.MediaSource.AnalyzeDurationMs * 1000).ToString();
|
(request.MediaSource.AnalyzeDurationMs * 1000).ToString();
|
||||||
}
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
|
||||||
|
{
|
||||||
|
analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration;
|
||||||
|
}
|
||||||
|
|
||||||
var forceEnableLogging = request.MediaSource.Protocol != MediaProtocol.File;
|
var forceEnableLogging = request.MediaSource.Protocol != MediaProtocol.File;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user