Apply suggestions from code review

Co-Authored-By: Bond-009 <bond.009@outlook.com>
This commit is contained in:
Vasily 2019-10-27 16:47:00 +03:00 committed by GitHub
parent 3743137c31
commit dd7ae7747e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -321,6 +321,7 @@ namespace MediaBrowser.Api.Playback
} }
Logger.LogDebug("StartFfMpeg() finished successfully"); Logger.LogDebug("StartFfMpeg() finished successfully");
return transcodingJob; return transcodingJob;
} }

View File

@ -504,6 +504,7 @@ namespace MediaBrowser.Api.Playback.Hls
continue; // avoid unnecessary waiting if segment just became available continue; // avoid unnecessary waiting if segment just became available
} }
} }
await Task.Delay(100, cancellationToken).ConfigureAwait(false); await Task.Delay(100, cancellationToken).ConfigureAwait(false);
} }
@ -923,7 +924,8 @@ namespace MediaBrowser.Api.Playback.Hls
} }
else else
{ {
var keyFrameArg = string.Format(CultureInfo.InvariantCulture, var keyFrameArg = string.Format(
CultureInfo.InvariantCulture,
" -force_key_frames:0 \"expr:gte(t,{0}+n_forced*{1})\"", " -force_key_frames:0 \"expr:gte(t,{0}+n_forced*{1})\"",
GetStartNumber(state) * state.SegmentLength, GetStartNumber(state) * state.SegmentLength,
state.SegmentLength); state.SegmentLength);
@ -934,7 +936,8 @@ namespace MediaBrowser.Api.Playback.Hls
// Example: we encoded half of desired length, then codec detected // Example: we encoded half of desired length, then codec detected
// scene cut and inserted a keyframe; next forced keyframe would // scene cut and inserted a keyframe; next forced keyframe would
// be created outside of segment, which breaks seeking. // be created outside of segment, which breaks seeking.
keyFrameArg += string.Format(CultureInfo.InvariantCulture, keyFrameArg += string.Format(
CultureInfo.InvariantCulture,
" -g {0} -keyint_min {0}", " -g {0} -keyint_min {0}",
(int)(state.SegmentLength * state.TargetFramerate) (int)(state.SegmentLength * state.TargetFramerate)
); );