mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
Small code cleanup
This commit is contained in:
parent
9865c841bd
commit
59e43973eb
|
@ -226,12 +226,12 @@ namespace BililiveRecorder.Core.Recording
|
|||
}
|
||||
|
||||
const int DefaultQn = 10000;
|
||||
var selected_qn = DefaultQn;
|
||||
var codecItem = await this.apiClient.GetCodecItemInStreamUrlAsync(roomid: roomid, qn: DefaultQn).ConfigureAwait(false);
|
||||
|
||||
if (codecItem is null)
|
||||
throw new Exception("no supported stream url, qn: " + DefaultQn);
|
||||
|
||||
int selected_qn;
|
||||
// Select first avaiable qn
|
||||
foreach (var qn in qns)
|
||||
{
|
||||
|
@ -298,8 +298,6 @@ namespace BililiveRecorder.Core.Recording
|
|||
{
|
||||
this.logger.Debug("用户脚本指定了服务器 IP {IP}", scriptIp);
|
||||
|
||||
request = new HttpRequestMessage(HttpMethod.Get, fullUrl);
|
||||
|
||||
var uri = new Uri(fullUrl);
|
||||
var builder = new UriBuilder(uri)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace BililiveRecorder.Core
|
|||
this.basicDanmakuWriter = basicDanmakuWriter ?? throw new ArgumentNullException(nameof(basicDanmakuWriter));
|
||||
this.recordTaskFactory = recordTaskFactory ?? throw new ArgumentNullException(nameof(recordTaskFactory));
|
||||
|
||||
this.timer = new Timer(this.RoomConfig.TimingCheckInterval * 1000);
|
||||
this.timer = new Timer(this.RoomConfig.TimingCheckInterval * 1000d);
|
||||
this.cts = new CancellationTokenSource();
|
||||
this.ct = this.cts.Token;
|
||||
|
||||
|
@ -555,7 +555,7 @@ namespace BililiveRecorder.Core
|
|||
this.logger = this.loggerWithoutContext.ForContext(LoggingContext.RoomId, this.RoomConfig.RoomId);
|
||||
break;
|
||||
case nameof(this.RoomConfig.TimingCheckInterval):
|
||||
this.timer.Interval = this.RoomConfig.TimingCheckInterval * 1000;
|
||||
this.timer.Interval = this.RoomConfig.TimingCheckInterval * 1000d;
|
||||
break;
|
||||
case nameof(this.RoomConfig.AutoRecord):
|
||||
if (this.RoomConfig.AutoRecord)
|
||||
|
|
|
@ -84,8 +84,6 @@ namespace BililiveRecorder.Flv.Grouping
|
|||
firstTag
|
||||
};
|
||||
|
||||
firstTag = null;
|
||||
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
var tag = await this.TagReader.ReadTagAsync(token).ConfigureAwait(false);
|
||||
|
|
|
@ -104,11 +104,11 @@ namespace BililiveRecorder.Flv.Parser
|
|||
|
||||
if (result.IsCompleted)
|
||||
{
|
||||
if (buffer.Length > 0)
|
||||
{
|
||||
// The message is incomplete and there's no more data to process.
|
||||
// throw new FlvException("Incomplete message.");
|
||||
}
|
||||
//if (buffer.Length > 0)
|
||||
//{
|
||||
//// The message is incomplete and there's no more data to process.
|
||||
//// throw new FlvException("Incomplete message.");
|
||||
//}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -36,8 +36,6 @@ namespace BililiveRecorder.Flv.Pipeline.Rules
|
|||
var multiple_header_present = false;
|
||||
|
||||
// 音频 视频 分别单独处理
|
||||
var group = header.AllTags.GroupBy(x => x.Type);
|
||||
|
||||
var currentVideoHeader = SelectHeader(ref multiple_header_present, header.AllTags.ToStructEnumerable().Where(ref LinqFunctions.TagIsVideo, x => x));
|
||||
var currentAudioHeader = SelectHeader(ref multiple_header_present, header.AllTags.ToStructEnumerable().Where(ref LinqFunctions.TagIsAudio, x => x));
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ namespace BililiveRecorder.ToolBox.Tool.DanmakuMerger
|
|||
if (els.Count == 0)
|
||||
break;
|
||||
|
||||
(var time, var el, var readerIndex) = els[0];
|
||||
(_, var el, var readerIndex) = els[0];
|
||||
el.WriteTo(writer);
|
||||
els.RemoveAt(0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user