mirror of https://github.com/jellyfin/jellyfin.git
Apply suggestions from code review
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
parent
51dab0958d
commit
5ff08338d5
|
@ -578,7 +578,7 @@ namespace Jellyfin.Api.Controllers
|
|||
args += _encodingHelper.GetOutputSizeParam(state, _encodingOptions, codec);
|
||||
}
|
||||
|
||||
if (!(state.SubtitleStream != null && state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream))
|
||||
if (state.SubtitleStream == null || !state.SubtitleStream.IsExternal || state.SubtitleStream.IsTextSubtitleStream)
|
||||
{
|
||||
args += " -start_at_zero";
|
||||
}
|
||||
|
|
|
@ -1025,14 +1025,12 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
if (streamInfo != null && streamInfo.Tags != null)
|
||||
{
|
||||
var bps = GetDictionaryValue(streamInfo.Tags, "BPS-eng") ?? GetDictionaryValue(streamInfo.Tags, "BPS");
|
||||
if (!string.IsNullOrEmpty(bps))
|
||||
{
|
||||
if (int.TryParse(bps, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedBps))
|
||||
if (!string.IsNullOrEmpty(bps)
|
||||
&& int.TryParse(bps, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedBps))
|
||||
{
|
||||
return parsedBps;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1042,14 +1040,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
if (streamInfo != null && streamInfo.Tags != null)
|
||||
{
|
||||
var duration = GetDictionaryValue(streamInfo.Tags, "DURATION-eng") ?? GetDictionaryValue(streamInfo.Tags, "DURATION");
|
||||
if (!string.IsNullOrEmpty(duration))
|
||||
{
|
||||
if (TimeSpan.TryParse(duration, out var parsedDuration))
|
||||
if (!string.IsNullOrEmpty(duration) && TimeSpan.TryParse(duration, out var parsedDuration))
|
||||
{
|
||||
return parsedDuration.TotalSeconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1059,14 +1054,12 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
if (streamInfo != null && streamInfo.Tags != null)
|
||||
{
|
||||
var numberOfBytes = GetDictionaryValue(streamInfo.Tags, "NUMBER_OF_BYTES-eng") ?? GetDictionaryValue(streamInfo.Tags, "NUMBER_OF_BYTES");
|
||||
if (!string.IsNullOrEmpty(numberOfBytes))
|
||||
{
|
||||
if (long.TryParse(numberOfBytes, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedBytes))
|
||||
if (!string.IsNullOrEmpty(numberOfBytes)
|
||||
&& long.TryParse(numberOfBytes, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedBytes))
|
||||
{
|
||||
return parsedBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue