AI automatically translates all comments in the code into English (#3917)

This commit is contained in:
alex
2024-09-19 14:53:50 +08:00
committed by GitHub
parent 046de691cb
commit 4152dcd409
279 changed files with 10602 additions and 3038 deletions

View File

@@ -54,18 +54,21 @@ void PusherProxy::publish(const string &dst_url) {
auto src = strong_self->_weak_src.lock();
if (!err) {
// 推流成功
// 推流成功 [AUTO-TRANSLATED:28ce6e56]
// Stream successfully pushed
strong_self->_live_ticker.resetTime();
strong_self->_live_status = 0;
*failed_cnt = 0;
InfoL << "Publish " << dst_url << " success";
} else if (src && (*failed_cnt < strong_self->_retry_count || strong_self->_retry_count < 0)) {
// 推流失败,延时重试推送
// 推流失败,延时重试推送 [AUTO-TRANSLATED:92b094ae]
// Stream failed, retry pushing with delay
strong_self->_republish_count++;
strong_self->_live_status = 1;
strong_self->rePublish(dst_url, (*failed_cnt)++);
} else {
// 如果媒体源已经注销, 或达到了最大重试次数,回调关闭
// 如果媒体源已经注销, 或达到了最大重试次数,回调关闭 [AUTO-TRANSLATED:444adf27]
// If the media source has been deregistered, or the maximum retry count has been reached, callback to close
strong_self->_on_close(err);
}
});
@@ -77,19 +80,22 @@ void PusherProxy::publish(const string &dst_url) {
}
if (*failed_cnt == 0) {
// 第一次重推更新时长
// 第一次重推更新时长 [AUTO-TRANSLATED:5f778703]
// Update duration for the first re-push
strong_self->_live_secs += strong_self->_live_ticker.elapsedTime() / 1000;
strong_self->_live_ticker.resetTime();
TraceL << " live secs " << strong_self->_live_secs;
}
auto src = strong_self->_weak_src.lock();
// 推流异常中断,延时重试播放
// 推流异常中断,延时重试播放 [AUTO-TRANSLATED:e69e5a05]
// Stream abnormally interrupted, retry playing with delay
if (src && (*failed_cnt < strong_self->_retry_count || strong_self->_retry_count < 0)) {
strong_self->_republish_count++;
strong_self->rePublish(dst_url, (*failed_cnt)++);
} else {
// 如果媒体源已经注销, 或达到了最大重试次数,回调关闭
// 如果媒体源已经注销, 或达到了最大重试次数,回调关闭 [AUTO-TRANSLATED:444adf27]
// If the media source has been deregistered, or the maximum retry count has been reached, callback to close
strong_self->_on_close(err);
}
});
@@ -103,7 +109,8 @@ void PusherProxy::rePublish(const string &dst_url, int failed_cnt) {
_timer = std::make_shared<Timer>(
delay / 1000.0f,
[weak_self, dst_url, failed_cnt]() {
// 推流失败次数越多,则延时越长
// 推流失败次数越多,则延时越长 [AUTO-TRANSLATED:bda77afe]
// The more times the stream fails, the longer the delay
auto strong_self = weak_self.lock();
if (!strong_self) {
return false;