Apply suggestions from code review

Co-authored-by: BaronGreenback <jimcartlidge@yahoo.co.uk>
This commit is contained in:
Nyanmisaka 2020-11-14 10:19:41 +00:00 committed by GitHub
parent fc89b7e641
commit 06670351ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -1453,7 +1453,7 @@ namespace Jellyfin.Api.Controllers
|| string.Equals(state.MediaSource.Container, "hls", StringComparison.OrdinalIgnoreCase)))
{
bitStreamArgs = _encodingHelper.GetBitStreamArgs(state.AudioStream);
bitStreamArgs = !string.IsNullOrEmpty(bitStreamArgs) ? " " + bitStreamArgs : string.Empty;
bitStreamArgs = string.IsNullOrEmpty(bitStreamArgs) ? string.Empty : " " + bitStreamArgs;
}
return "-acodec copy -strict -2" + bitStreamArgs;
@ -1494,7 +1494,7 @@ namespace Jellyfin.Api.Controllers
|| string.Equals(state.MediaSource.Container, "hls", StringComparison.OrdinalIgnoreCase)))
{
bitStreamArgs = _encodingHelper.GetBitStreamArgs(state.AudioStream);
bitStreamArgs = !string.IsNullOrEmpty(bitStreamArgs) ? " " + bitStreamArgs : string.Empty;
bitStreamArgs = string.IsNullOrEmpty(bitStreamArgs) ? string.Empty : " " + bitStreamArgs;
}
if (EncodingHelper.IsCopyCodec(videoCodec) && state.EnableBreakOnNonKeyFrames(videoCodec))

View File

@ -448,7 +448,7 @@ namespace Jellyfin.Api.Controllers
|| string.Equals(state.MediaSource.Container, "hls", StringComparison.OrdinalIgnoreCase)))
{
bitStreamArgs = _encodingHelper.GetBitStreamArgs(state.AudioStream);
bitStreamArgs = !string.IsNullOrEmpty(bitStreamArgs) ? " " + bitStreamArgs : string.Empty;
bitStreamArgs = string.IsNullOrEmpty(bitStreamArgs) ? string.Empty : " " + bitStreamArgs;;
}
return "-acodec copy -strict -2" + bitStreamArgs;

View File

@ -605,7 +605,7 @@ namespace MediaBrowser.Controller.MediaEncoding
public string GetBitStreamArgs(MediaStream stream)
{
// TODO This is auto inserted into the mpegts mux so it might not be needed
// TODO This is auto inserted into the mpegts mux so it might not be needed.
// https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmp4toannexb
if (IsH264(stream))
{
@ -617,7 +617,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
else if (IsAAC(stream))
{
// convert adts header(mpegts) to asc header(mp4)
// Convert adts header(mpegts) to asc header(mp4).
return "-bsf:a aac_adtstoasc";
}
else