FLV: Fixed a bug where the time of keyframes indexes are in wrong unit.

结果就发到正式版里去了,发版之前最后一个加的、测试的最少的功能。
好淦哦
This commit is contained in:
Genteure 2021-05-15 00:49:47 +08:00
parent 89a497bd96
commit c12ea90b2b
2 changed files with 4 additions and 4 deletions

View File

@ -157,7 +157,7 @@ namespace BililiveRecorder.Flv.Writer
value["duration"] = (ScriptDataNumber)duration;
if (updateKeyframes && this.keyframesScriptDataValue is not null)
this.keyframesScriptDataValue.AddData(keyframeTime, filePosition);
this.keyframesScriptDataValue.AddData(time_in_ms: keyframeTime, filePosition: filePosition);
this.BeforeScriptTagRewrite?.Invoke(this.lastScriptBody);

View File

@ -37,12 +37,12 @@ namespace BililiveRecorder.Flv.Writer
private readonly List<Data> KeyframesData = new();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void AddData(double time, double filePosition)
public void AddData(double time_in_ms, double filePosition)
{
var keyframesData = this.KeyframesData;
if (keyframesData.Count < MaxDataCount && (keyframesData.Count == 0 || ((time - keyframesData[keyframesData.Count - 1].Time) > MinInterval)))
if (keyframesData.Count < MaxDataCount && (keyframesData.Count == 0 || ((time_in_ms - keyframesData[keyframesData.Count - 1].Time) > MinInterval)))
{
keyframesData.Add(new Data(time: time, filePosition: filePosition));
keyframesData.Add(new Data(time: time_in_ms / 1000d, filePosition: filePosition));
}
}