mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
FLV: Fixed a bug where the time of keyframes indexes are in wrong unit.
结果就发到正式版里去了,发版之前最后一个加的、测试的最少的功能。 好淦哦
This commit is contained in:
parent
89a497bd96
commit
c12ea90b2b
|
@ -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);
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user