mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
25 lines
624 B
C#
25 lines
624 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BililiveRecorder.Flv.Pipeline.Rules
|
|
{
|
|
/// <summary>
|
|
/// 处理收到 Script Tag 的情况
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 本规则为一般规则
|
|
/// </remarks>
|
|
public class HandleNewScriptRule : ISimpleProcessingRule
|
|
{
|
|
public Task RunAsync(FlvProcessingContext context, Func<Task> next)
|
|
{
|
|
if (context.OriginalInput is PipelineScriptAction)
|
|
{
|
|
context.AddNewFileAtStart();
|
|
return Task.CompletedTask;
|
|
}
|
|
else return next();
|
|
}
|
|
}
|
|
}
|